Contains one or more frames, separated by horizontal and/or vertical dividers. The dividers can be repositioned by clicking on them and dragging the mouse.


hwtk::splitframe - pathName ?option value? …

Standard Options

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.
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.
Database name: height
Database class: Height
If specified, the widget’s requested height in pixels.
Database name: help
Database class: Text
Specifies the text or help message that displays when the cursor moves over the widget.
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.
Database name: width
Database class: Width
Specifies the width of a widget.

Widget Specific Options

Database name: orient
Database class: Orient
Specifies the orientation whether the widget should be laid out horizontally or vertically. Must be either horizontal or vertical or an abbreviation of one of these. Default is horizontal.
Database name: refreshondrag
Database class: RefreshOnDrag
Designates whether the frame should be refreshed when a divider is repositioned by dragging. A value of 1 results in a refresh; a value of 0 does not.
Database name: sashcommand
Database class: Command
Command to be invoked whenever the sash is moved/repositioned. The command can be registered by the user to get the callback whenever the sash is moved.
Database name: showbutton
Database class: Showbutton
Display or hide collapse button in the upper right corner of the frame. Values are 1 and 0. Default is 0 (hidden).

Widget Commands

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
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:
will restore pathName to the original state. If stateSpec is not specified, returns a list of the currently-enabled state flags.
pathName add subwindow
Adds a pane to the splitframe.
pathName forget pane
Removes/unmanages the specified pane.
pathName hidepane pane
Hides the specified pane.
pathName insert pos subwindow ?arg arg...?
Inserts a pane into the splitframe, at the position given by pos.
pathName set ?arg arg …?
Sets the entry’s value to arg.
pathName lock arg
Locks or unlocks the sashes. Locked sashes cannot be repositioned. If arg is true or 1, the sashes will be locked; if arg is false or 0, the sashes will be unlocked.
pathName pane pane -option ?value …?
Modifies/returns the options of the specified pane. The behavior of this command is as follows: If -option is not specified, a list of the pane option values is returned. If only one -option is given, the value of that option is returned. If -option/value pairs are specified, the specified options are set to the given values.
pathName panes
Returns a list of panes contained in the splitframe widget.
pathName remove pane
Removes the given pane from the splitframe widget.
pathName sashpos index ?arg arg …?
Positions the sash/divider at the location given by index.
pathName showpane pane
Shows the specified pane.


::hwtk::dialog .dlg -title ::hwtk::splitframe
set w [.dlg recess]

set pw1 [hwtk::splitframe $w.pw -orient horizontal]
pack $pw1 -fill both -expand true 

frame $pw1.f1

set pw2 [hwtk::splitframe $pw1.pw2 -orient vertical]
set pw3 [hwtk::splitframe $pw2.pw3 -orient horizontal]

frame $pw2.f1
frame $pw3.f1
frame $pw3.f2

pack [label $pw1.f1.11 -text "label 1"]
pack [label $pw2.f1.11 -text "label 2"]
pack [label $pw3.f1.12 -text "label 3"]
pack [label $pw3.f2.12 -text "label 3"]

$pw1 add $pw1.f1
$pw1 add $pw2
$pw2 add $pw2.f1
$pw2 add $pw3
$pw3 add $pw3.f2

.dlg post