home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / tcl / 1026 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.8 KB  |  56 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ucla-cs!oahu.cs.ucla.edu!andylee
  3. From: andylee@oahu.cs.ucla.edu (Andy Lee)
  4. Subject: Problem between Canvas Text and Scrollbar
  5. Message-ID: <1992Jul22.194933.12237@cs.ucla.edu>
  6. Sender: usenet@cs.ucla.edu (Mr Usenet)
  7. Nntp-Posting-Host: oahu.cs.ucla.edu
  8. Organization: UCLA, Computer Science Department
  9. Date: Wed, 22 Jul 92 19:49:33 GMT
  10. Lines: 44
  11.  
  12. Hello,
  13.  
  14. I am new to this group, forgive me if this problem has been discussed
  15. already.  The 'problem' is between a canvas containing text and a
  16. vertical scrollbar.  Here is a small wish script that demonstrates the
  17. problem:
  18.  
  19. ---------- Scripts Starts Here 8< ----------
  20.  
  21. #!wish -f
  22. #
  23. # Problem between canvas text and vertical scroll bar
  24. #
  25.  
  26. # Create a scroll bar and a canvas
  27. pack append . \
  28.         [scrollbar .scrollbar -command ".canvas yview"] {left filly} \
  29.         [canvas .canvas -yscrollcommand ".scrollbar set"] {left expand}
  30.  
  31. # Write 100 lines of canvas text
  32. set canvastext [.canvas create text 0 0 -anchor nw -justify left \
  33.         -text "Canvas Test:\n"]
  34. for {set i 1} {$i <= 100} {incr i} {
  35.         .canvas insert $canvastext end "Line $i\n"}
  36.  
  37. ---------- Script Ends Here 8< ----------
  38.  
  39. The initial scrollbar slider occupides the entire scroll space, but as
  40. soon as I press the lower arrow, the slider becomes just a small line.
  41. And the arrows let me scroll past the text (either above or below),
  42. which is not desirable.
  43.  
  44. Any help is greatly appreciated...
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. -- 
  52. Andy A. Lee           UCLA MS Graduate Student, AI Neural Networks
  53. andylee@cs.ucla.edu   Down-to-Earth Idealist & Independent NeXT Developer
  54. (310)824-7131         "If you don't watch your figure, who will?" - TV Ad.
  55. (310)208-0200         "Trust is earned, not given away." - Star Trek: TNG
  56.