home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1854 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.3 KB

  1. Path: sparky!uunet!ukma!wupost!spool.mu.edu!agate!ygdrasil.CS.Berkeley.EDU!faustus
  2. From: faustus@ygdrasil.CS.Berkeley.EDU (Wayne A. Christopher)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Scrollable buttons?
  5. Date: 17 Nov 1992 19:15:39 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 25
  8. Message-ID: <1ebgcrINNmt7@agate.berkeley.edu>
  9. References: <1992Nov17.102654.15449@dxcern.cern.ch> <1992Nov17.151657.3467@cis.ohio-state.edu>
  10. NNTP-Posting-Host: ygdrasil.cs.berkeley.edu
  11.  
  12. In article <1992Nov17.151657.3467@cis.ohio-state.edu> mdm@stegosaur.cis.ohio-state.edu (Michael Moore) writes:
  13.  
  14. [ A bunch of code to make a frame with a canvas and a scrollbar... ]
  15. > for {set i 0} {$i < 25} {incr i} {
  16. >    button .frame.canvas.button$i  \
  17. >    -relief raised \
  18. >    -text "Button $i"
  19. >    .frame.canvas create window 40 [expr $i*25] \
  20. >    -window .frame.canvas.button$i 
  21. > }
  22.  
  23. The problem here is that you have to know the size of the buttons
  24. beforehand.  Could you do the following?  (I haven't tried it but I
  25. will.)
  26.  
  27. - make a canvas with a scrollbar
  28. - put a frame somewhere in the canvas
  29. - pack all the buttons in the frame
  30. - see how big the frame is
  31. - set the canvas scroll region appropriately
  32.  
  33. Has anybody written a scrolled frame?  That ought to be an easy widget
  34. to write.  (I know, why don't I write it...)
  35.  
  36.     Wayne
  37.