Frames and Toplevel Windows

Frames have been introduced before for use with the geometry managers. There is not much to a frame, except for its background color and border. You can also specify a colormap and visual type for a frame. Chapter 38 describes visual types and colormaps on page 540.

A toplevel widget is like a frame, except that it is created as a new main window. That is, it is not positioned inside the main window of the application. This is useful for dialog boxes, for example. A toplevel has the same attributes as a frame, plus screen and menu attributes. The menu attribute is used to create menubars along the top edge of a toplevel. This feature was added in Tk 8.0, and it is described on page 397. On UNIX, the screen option lets ...

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.