| 13.8 Tricks for Using Pack |
|
|
This section contains two tricks.
Figure 13.8a shows a single frame with three white boxes and two expanding frames in between. As shown, the root window has been expanded by the user. The expanding, but empty, frames serve to keep an even spacing between the boxes. This is a fairly common use for a frame. A very similar example was given in Exercise 13.3b.
Frames make good spacing but they are not necessary if what you want to do is put a widget on either end of a slice. To place two widgets so that they stick on either end of a slice, just vary the -side options to get them there.
Sizing Text-Based WidgetsIt sometimes happens that you wish that text-based widgets had height and width dimensions of the same kind as other widgets instead of height and width dimensions that are measured in numbers of characters. You do not get your wish, but you can ask the text-based widget to conform to other measurements. Do the following in the order stated:
Normally, the packer calculates the size needed by a master's slaves and then tries to size the frame accordingly. The size of the subwindows is propagating upwards. When you use pack propagate, the packer will attempt to keep the widget you name the size you have requested with the -height and -width options.
|
Author's Home Page |
|
Order from Amazon. |