Posted to tcl by de at Mon Jul 14 17:39:28 GMT 2014view raw

  1.  
  2. # Using the same tktable binary I see a huge speed difference between
  3. #
  4. # tcl/tk 8.5.8 (all fine and good)
  5. #
  6. # and
  7. #
  8. # tcl/tk 8.6.1 (waaay too slow)
  9. #
  10. # Just try to scroll down.
  11.  
  12. package require Tk
  13. package require Tktable
  14.  
  15. proc cellcmd {row column} {
  16. return [string repeat "$row, $column " 100]
  17. }
  18.  
  19. scrollbar .hs -orient horizontal -command ".table xview"
  20. scrollbar .vs -orient vertical -command ".table yview"
  21.  
  22. table .table \
  23. -cols 20 \
  24. -rows 1000000 \
  25. -colstretchmode none \
  26. -xscrollcommand ".hs set" \
  27. -yscrollcommand ".vs set" \
  28. -command {cellcmd %r %c} \
  29. -usecommand 1 \
  30. -cache 0
  31.  
  32. grid .table -row 0 -column 0 -sticky news
  33. grid .vs -row 0 -column 1 -sticky ns
  34. grid .hs -row 1 -column 0 -sticky we
  35.  
  36. grid rowconfigure . 0 -weight 1
  37. grid columnconfigure . 0 -weight 1
  38.  
  39. wm geometry . 1000x800
  40.