hwtk::buttonbox

Container widget that manages buttons.

Format

hwtk::buttonbox - pathName ?option value? …

Description

A hwtk::buttonbox widget manages a framed area with motif style buttons. The button box can be configured either horizontally or vertically.

Standard Options

-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.
-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.

Widget Specific Options

-orient
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.

Widget Commands

In addition to the standard configure, cget, identify, instate, and state commands, this command support the following additional widget commands:
pathName add tag ?arg arg …?
Adds buttons to the buttonbox container with additional button options. See Widget-Specific Options in hwtk::button for valid button options.
pathName buttoncget index option
Gets information about a specified button of the buttonbox container. Where index is the button’s named tag from the add command, default or end. See Widget-Specific Options in hwtk::button for valid button options.
pathName buttonconfigure index ?arg arg …?
Configures attributes for a specified button of the buttonbox container. Where index is the button’s named tag from the add command, default or end. See Widget-Specific Options in hwtk::button for valid button options.
pathName buttonlist ?all?
If used without any arguments, returns a list of all shown buttons. If the argument all is used then all buttons both shown and hidden are returned.
pathName cget option
Returns the current value of the configuration option given by option.
pathName component ?name?
Returns the components of the buttonbox container if no name is specified. If a name is specified, then it returns the path to that component of the container.
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 default ?index?
The default button is the button that gets invoked when the user presses Enter. Depending on the theme, the default button may be displayed with an extra highlight ring, or with a different border color. If no index is specified, it returns the currently assigned default button. If an index is specified, then that button will be set to the current default.
pathName delete tag
Deletes the button given by tag from the buttonbox container and from memory.
pathName exists tag
Checks for existence of a button given by tag in the buttonbox container.
pathName hide index
Hides the button given by index, where index is the button’s named tag from the add command, default or end. Unlike the delete command, the button still exists in memory.
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 insert index tag ?arg arg …?
Creates and inserts a new button into the buttonbox container where tag is button to be newly created and inserted. Index is the named index of an already existing button in the container. See Widget-Specific Options in hwtk::button for valid button options.
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 invoke tag
Invokes the script assigned to the button given by tag.
pathName show index
Shows an already existing buttonbox button given by index, where index is the button’s named tag from the add command, default or end which has been previously hidden.
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::buttonbox"
set bb [hwtk::buttonbox [.d recess] .bb -orient vertical]
foreach but {One Two Three } {
    $bb add $but -text $but -help "Button $but added."
}
pack $bb
.d post