Why is this happening and how do I work around whatever is causing it?
Hi Tclers --
I run the following code in wish 8.6.11 on Ubuntu 21.10:
. configure -background lightpink
pack [frame .m -background lightgreen] -side top -expand true -fill x
pack [button .m.b -text b] -side left
pack [canvas .c -background lightblue] -side top -expand true -fill both
It draws, as expected, a button bar and a canvas packed tight into the toplevel window.
If I resize the toplevel window horizontally, the button bar and canvas grow to fill the available size, as is expected.
If I resize the toplevel window vertically, the button bar and canvas do not grow to fill the available size. The canvas grows some and the button bar gets centered in the remaining vertical space.
The expected behavior is that the button bar and canvas continue to tightly pack the toplevel window no matter how the window is resized.
I've tried setting -ipady and -pady explicitly.
I can use -anchor n and -anchor s to move the button bar to the top or bottom of the extra vertical space.
I've switched between the default Wayland desktop and the 'Xorg' desktop.
Why is this happening and how do I work around whatever is causing it?
Thanks for any clues,
-- rec --
Am 12.12.21 um 17:02 schrieb Roger Critchlow:[ ... ]
Since you packed the frame .m using "-side top", the with of the parcel allocated for it will be in sync with that of its cavity, i.e., with the width of ".". From this it follows that specifying "-expand true" for
.m means: "expand its parcel vertically whenever there is extra vertical space for it". Consequently, in order to get the desired behavior, you
will have to pack this frame without specifying "-expand true". The
"-fill x" remains necessary here, but it works independently of -expand.
On Sunday, December 12, 2021 at 1:02:44 PM UTC-5, nemethi wrote:
Am 12.12.21 um 17:02 schrieb Roger Critchlow:[ ... ]
Since you packed the frame .m using "-side top", the with of the parcel
allocated for it will be in sync with that of its cavity, i.e., with the
width of ".". From this it follows that specifying "-expand true" for
.m means: "expand its parcel vertically whenever there is extra vertical
space for it". Consequently, in order to get the desired behavior, you
will have to pack this frame without specifying "-expand true". The
"-fill x" remains necessary here, but it works independently of -expand.
That's it! The -expand true is unnecesary for the button bar frame. Thank you very much!
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 32:46:36 |
Calls: | 6,449 |
Calls today: | 1 |
Files: | 12,052 |
Messages: | 5,254,898 |