Packing toward a Side

The following example creates two frames and packs them toward the top side of the main window. The upper frame, .one, is not as big and the main window shows through on either side. The children are packed toward the specified side in order, so .one is on top. The four possible sides are: top, right, bottom, and left. The top side is the default.

Example 23-1 Two frames packed inside the main frame.

# Make the main window black
. config -bg black
# Create and pack two frames
frame .one -width 40 -height 40 -bg white
frame .two -width 100 -height 50 -bg grey50
pack .one .two -side top

Shrinking Frames and pack propagate ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.