hwtk::frame

Simple container widget.

Format

hwtk::frame - pathName ?option value? …

Description

A hwtk::frame widget is a container, used to group other widgets together.

Standard Options

-borderwidth
Database name: borderWidth
Database class: BorderWidth
The desired width of the widget border. Defaults to 0.
-clientdata
Database name: clientData
Database class: ClientData
Acts as a data storage for a widgets. User can store any data and this will not have any effect on widget property.
-cursor
Database name: cursor
Database class: Cursor
Specifies the mouse cursor to be used for the widget. See Tk_GetCursor and cursors(n) in the Tk reference manual for the legal values. If set to the empty string (the default), the cursor is inherited from the parent widget.
-height
Database name: height
Database class: Height
If specified, the widget’s requested height in pixels.
-help
Database name: help
Database class: Text
Specifies the text or help message that displays when the cursor moves over the widget.
-helpcommand
Database name: helpcommand
Database class: Command
Dynamic help which calls an assigned -helpcommand when the user moves the mouse on the widget. The text which is returned by the -helpcommand will be in turn be displayed on the tooltip.
-relief
Database name: relief
Database class: Relief
Specifies the 3D effect desired for the widget. Acceptable values are raised, sunken, flat, ridge, solid, and groove. The value indicates how the interior of the widget should appear relative to its exterior; for example, raised means the interior of the widget should appear to protrude from the screen, relative to the exterior of the widget.
-takefocus
Database name: takeFocus
Database class: TakeFocus
Determines whether the window accepts the focus during keyboard traversal. Either 0, 1, a command prefix (to which the widget path is appended, and which should return 0 or 1), or the empty string. See options(n) in the Tk reference manual for the full description.
-width
Database name: width
Database class: Width
Specifies the width of a widget.

Widget-Specific Options

-container
Database name: container
Database class: Container
The value must be a boolean. If true, it means that this window will be used as a container in which some other application will be embedded (for example, a Tk toplevel can be embedded using the -use option). The window will support the appropriate window manager protocols for things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the configure widget command. Note that -borderwidth, -padx and -pady are ignored when configured as a container since a container has no border. Defaults to false.
-relief
Database name: relief
Database class: Relief
One of the standard Tk border styles: flat, groove, raised, ridge, solid, or sunken. Defaults to flat.

Widget Command

pathName configure ?option? ?value option value …?
Query or modify the configuration options of the widget. If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. If option is specified with no value, then the command returns a list describing the named option: the elements of the list are the option name, database name, database class, default value, and current value. If no option is specified, returns a list describing all of the available options for pathName.
pathName cget option
Returns the current value of the configuration option given by option.
pathName identify element x y
Returns the name of the element under the point given by x and y, or an empty string if the point does not lie within any element. x and y are pixel coordinates relative to the widget. Some widgets accept other identify subcommands.
pathName instate statespec ?script?
Test the widget’s state. If script is not specified, returns 1 if the widget state matches statespec and 0 otherwise. If script is specified, equivalent to
if{[pathNameinstatestateSpec]}script
pathName state ?stateSpec?
Modify or inquire widget state. If stateSpec is present, sets the widget state: for each flag in stateSpec, sets the corresponding flag or clears it if prefixed by an exclamation point. Returns a new state spec indicating which flags were changed:
setchanges[pathNamestatespec]
pathNamestate$changes
will restore pathName to the original state. If stateSpec is not specified, returns a list of the currently-enabled state flags.

Example

::hwtk::dialog .d -title "::hwtk::frame"
set f [.d recess]

hwtk::frame $f.fl 
hwtk::label $f.f1.e1 -text "Flat frame" -help "Flat frame"
hwtk::frame $f.f2 -relief raised -boderwidth 5 
hwtk::label $f.f2.e2 -text "Raised frame with border" -help "Raised frame"
hwtk::frame $f.f3 -relief sunken 
hwtk::label $f.f3.e3 -text "Sunken frame" -help "Sunken frame"

hwtk::label $f.l4 -text "Disabled"
hwtk::entry $f.e4 -state disabled -help "Disabled entry"

pack $f.f1 $f.f2 $f.f3 -pady 4
pack $f.f1.e1 -side left 
pack $f.f2.e2 -side left 
pack $f.f3.e3 -side left -pady 4 -padx 4
 
.d post