home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1909 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.6 KB  |  42 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!caen!spencer
  3. From: spencer@med.umich.edu (Spencer W. Thomas)
  4. Subject: Re: Scrollable buttons?
  5. Message-ID: <SPENCER.92Nov20155807@guraldi.med.umich.edu>
  6. Date: Fri, 20 Nov 92 15:58:07 EST
  7. Organization: University of Michigan
  8. In-Reply-To: spencer@med.umich.edu's message of Thu, 19 Nov 92 03:18:42 EST
  9. References: <1992Nov17.102654.15449@dxcern.cern.ch>
  10.     <SPENCER.92Nov19031842@guraldi.med.umich.edu>
  11. Nntp-Posting-Host: guraldi.itn.med.umich.edu
  12. Lines: 28
  13.  
  14. In article <SPENCER.92Nov19031842@guraldi.med.umich.edu> spencer@med.umich.edu (Spencer W. Thomas) writes:
  15. > - Use winfo reqheight/reqwidth to figure out how big the window will
  16. >   be.
  17.  
  18. Sigh.  I got ahead of myself here.  Only some windows get reqheight
  19. and reqwidth right before they're realized (X technical term).  I
  20. tested it with a label, and it worked.  However, a form with a label
  21. and an entry inside it gives back reqheight/width of 0 until the next
  22. update.  I came up with this, which does work in my application.  It's
  23. better than my previous solution, which stacked all the windows at 0,0
  24. and then shuffled them to the appropriate final location.
  25.  
  26.     <Create windows, make a list of window names>
  27.  
  28.     update
  29.     # Note that the windows are not visible because they haven't
  30.     # been placed on the canvas yet.  But they do have a real
  31.     # height and width now.
  32.  
  33.     foreach w $windowlist {
  34.         <Compute appropriate x/y position>
  35.         canvas create window $x $y -window $w ....
  36.     }
  37.  
  38. --
  39. =Spencer W. Thomas         |  Info Tech and Networking, B1911 CFOB, 0704
  40.    "Genome Informatician"    |  Univ of Michigan, Ann Arbor, MI 48109
  41. Spencer.W.Thomas@med.umich.edu    |  313-747-2778, FAX 313-764-4133
  42.