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