home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / tcl / 1773 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.7 KB

  1. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: mixing fixed and variable components with the placer
  5. Date: 9 Nov 1992 19:38:49 GMT
  6. Organization: U.C. Berkeley Sprite Project
  7. Lines: 26
  8. Distribution: world
  9. Message-ID: <1dmeo9INNka@agate.berkeley.edu>
  10. References: <BxBEBz.K6z@cs.psu.edu>
  11. NNTP-Posting-Host: tyranny.berkeley.edu
  12.  
  13. In article <BxBEBz.K6z@cs.psu.edu>, schwartz@roke.cs.psu.edu (Scott Schwartz) writes:
  14. |> 
  15. |> Consider the following code fragment:
  16. |> 
  17. |> frame .frame -borderwidth 10 -geometry 700x100
  18. |> place [scrollbar .frame.scroll -relief sunken -command ".frame.list yview"] \
  19. |>     -in .frame -width 20 -relheight 1.0
  20. |> place [listbox .frame.list -yscroll ".frame.scroll set" -relief sunken \
  21. |>         -geometry 80x10 ] \
  22. |>     -in .frame -x 20 -relheight 1.0 -relwidth 0.97
  23. |> 
  24. |> This puts a scrollbar and a listbox in a frame using the placer.  One
  25. |> really unsightly feature is the ``-relwidth 0.97'' on the listbox.
  26. |> There doesn't seem to be a clean way to ask the placer to let an
  27. |> object fill the remaining space.  Because I want the scrollbar to be
  28. |> fixed width, no relwidth for the listbox will be correct.  Because the
  29. |> frame can change size, no fixed width will be correct.  What to do?
  30.  
  31. Use the packer instead.  It's designed just for situations like this.
  32. For example, if you create widgets as above (but omit the "place"
  33. commands), something like the following command should do the trick:
  34.  
  35. pack append .frame .frame.scroll {left filly} .frame.list {right expand fill}
  36.  
  37. I haven't actually tried this, so it may have bugs.  The placer isn't
  38. really very powerful and I don't recommend it except for special cases.
  39.