Chapter 25. The Pack Geometry Manager

This chapter explores the pack geometry manager that positions widgets on the screen.

Geometry managers arrange widgets on the screen. This chapter describes the pack geometry manager, which is a constraint-based system. The next two chapters describe the grid and place geometry managers. The pack and grid geometry managers are quite general, while place is used for special-purpose applications. This book uses pack a lot because it was the original geometry manager for Tk. The grid geometry manager was added in Tk 4.1.

A geometry manager uses one widget as a parent, and it arranges multiple children (also called slaves) inside the parent. The parent is almost always a frame, but this is not strictly necessary. ...

Get Practical Programming in Tcl and Tk, Fourth 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.