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 color to display in the traversal highlight region when the window does not have the input focus. |
|
Specifies the color to use for the traversal highlight rectangle that is drawn around the window when it has the input focus. |
|
Specifies a non-negative value indicating the width of the highlight rectangle to draw around the outside of the window. |
|
Specifies a non-negative value indicating how much extra space to request for the window in the X-direction. |
|
Specifies a non-negative value indicating how much extra space to request for the window in the Y-direction. |
|
Specifies the 3D effect desired for the window. Acceptable values are |
|
Determines whether or not the window accepts the focus during keyboard traversal. |
|
Specifies the background color to use when drawing. |
|
Specifies a class for the window. |
|
Specifies a color map to use for the window. |
|
The value must be a Boolean value. If |
|
Specifies the desired height for the window. |
|
Specifies visual information for the new window. |
|
Specifies the desired width for the window. |
18.119.159.178