hwtk::buttongroup
Container widget that manages buttons.
Format
hwtk::buttongroup - pathName ?option value? …
Description
A hwtk::buttongroup widget displays a frame in which buttons can be added.
Standard Options
- -clientdata
- Database name: clientData
- -cursor
- Database name: cursor
- -help
- Database name: help
- -helpcommand
- Database name: helpcommand
Widget Specific Options
- -border
- Database name: border
- -orient
- Database name: orient
Widget Commands
- pathName add tag ?options?
- Add a button to the buttongroup named tag. Use -text option to add text to the button. Default text is tag.
- pathName buttoncget index ?option?
- Returns information about a specified button in the buttongroup. Index is the button’s tag from the add command, default or end. See Widget-Specific Options in hwtk::button for valid buttongroup options.
- pathName buttonconfigure index ?option? ?value option value …?
- Configures attributes for a specified button in the buttongroup. Index is the button’s tag from the add command, default or end. See Widget-Specific Options in hwtk::button for valid buttongroup 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 buttongroup 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 delete index
- Deletes the button given by tag from the buttongroup container and from memory.
- pathName exists tag
- Checks for existence of a button given by tag in the buttongroup.
- pathName hide index
- Hides the button given by index, where index is the button’s 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 ?options?
- Creates and inserts a new button into the buttongroup 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 buttongroup 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 buttongroup 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:
will restore pathName to the original state. If stateSpec is not specified, returns a list of the currently-enabled state flags.setchanges[pathNamestatespec]
pathNamestate$changes
Example
::hwtk::dialog .dlg -title "::hwtk::buttongroup"
set w [.dlg recess]
::hwtk::buttongroup $w.bg1
$w.bg1 add b1 -text "Button One"
$w.bg1 add b2 -text "Button Two" -image productHyperWorks-24.png -compound right -help "Image button with text"
pack $w.bg1
hwtk::buttongroup $w.bg2 -border 1 -orient vertical
$w.bg2 add b3 -image productHyperWorks-24.png -state disabled -help "image only"
$w.bg2 add b4 -text "Push Me" -command {puts "Button Pushed"}
$w.bg2 insert b4 insertbutton -text "Inserted Button"
pack $w.bg2 -pady 10
.dlg post