Creating a frame widget
The frame widget is used as a container for other widgets. Although it works in and of itself, it accepts no input from the user nor does it provide feedback. It simplifies the layout of complex screens and adds to the appearance of the final product. To add a widget to a frame, we use the following syntax:
% 1 frame .f % 2 button .f.b text "My Button"
The naming hierarchy in Tcl is such that we prepend the name of the container. In this case, a frame is prepended to the button to instruct the interpreter that the button is contained within a container. A container can be a window, top level, canvas, or frame, as in the previous example.
The keywords are described in the Tk main pages as follows:
Standard keywords |
Interpretation |
---|---|
|
Specifies a non-negative value indicating the width of the border to draw around the outside of the window. |
|
Specifies the mouse cursor to be used for the window. |
|
Specifies the... |