iwidgets::buttonbox(1)
β¨ iwidgets::buttonbox β¨
okay bestie, this is the manual page for iwidgets::buttonbox from the [incr Widgets] collection π it makes a whole manager widget that holds all your buttons, keeps them cute and organized, and even has a lil default-button moment. no cap.
π NAME π
iwidgets::buttonbox β create and manipulate a manager widget for buttons
πΈ SYNOPSIS πΈ
iwidgets::buttonbox pathName ?options?
π¦ INHERITANCE π¦
itk::Widget <- iwidgets::buttonbox
so it's giving itk::Widget's whole lineage, and buttonbox is the main character at the end of the chain π
β¨ STANDARD OPTIONS β¨
backgroundcursor
these are the standard ones, and if you wanna know the deets, see the "options" manual entry. π
π WIDGET-SPECIFIC OPTIONS π
- Name:
orientClass:OrientCommand-Line Switch:-orient
Which way the button box goes: horizontal or vertical. Default is horizontal. lowkey the horizontal one is the default slay.
- Name:
padXClass:PadXCommand-Line Switch:-padx
How much non-negative padding space to leave between the button group and the outer edge of the button box, in the x direction. The value can be in any form that Tk_GetPixels accepts. Default is 5 pixels. β¨
- Name:
padYClass:PadYCommand-Line Switch:-pady
Same energy, y direction: a non-negative padding distance between the button group and the outer edge of the button box. Value can be anything Tk_GetPixels accepts. Default is 5 pixels. π
π DESCRIPTION π
The iwidgets::buttonbox command creates a manager widget for controlling buttons. It also supports displaying and invoking a default button β yes, the main character button gets its moment. And the whole box can be configured either horizontally or vertically. periodt.
π«Ά METHODS π«Ά
The iwidgets::buttonbox command creates a new Tcl command whose name is pathName. You use that command to do literally everything to the widget. General form:
pathName option ?arg arg ...?
option and the args decide what the command actually does. iykyk.
A lot of the widget commands for buttonbox take one argument that says which button of the button box we're operating on. These are called indexes, and they let you reference and manipulate buttons no matter what their current map state is. buttonbox indexes can be written in any of these forms:
numberβ specifies the button numerically, where0corresponds to the left/top-most button of the button box.endβ indicates the right/bottom-most button of the button box.defaultβ indicates the current default button of the button box. This is the button with the default ring displayed. πpatternβ if the index doesn't satisfy any of the forms above, this one gets used.patterngets pattern-matched against the tag of each button in the button box, in order from left/top to right/left, until a matching entry is found. The rules ofTcl_StringMatchare used. π
π₯ WIDGET-SPECIFIC METHODS π₯
pathName add tag argsβ Add a button distinguished bytagto the end of the button box. If there are extra arguments, they specify options to apply to the button. Check outPushButtonfor the options you can use. πpathName buttonconfigure index ?options?β This one's like theconfigurecommand, except it applies to the options for one individual button, whereasconfigureapplies to the options for the button box as a whole. The options can have any of the values accepted by thePushButtoncommand. If options are specified, they get modified as indicated and the command returns an empty string. If no options are specified, it returns a list describing the current options for entryindex(seeTk_ConfigureInfofor the format of that list). πpathName cget optionβ Returns the current value of the configuration option given byoption.optioncan have any of the values accepted by theiwidgets::buttonboxcommand. β¨pathName configure ?option? ?value option value ...?β Query or modify the configuration options of the widget. If nooptionis specified, it returns a list describing all the available options forpathName(seeTk_ConfigureInfofor the format of that list). Ifoptionis specified with novalue, the command returns a list describing that one named option β and this list is identical to the corresponding sublist of the value returned when no option is specified. If one or moreoption-valuepairs are specified, the command modifies the given widget option(s) to have the given value(s), and in that case it returns an empty string.optioncan have any of the values accepted by theiwidgets::buttonboxcommand. πpathName default indexβ Sets the default button to the button given byindex. This causes the default ring to appear around the specified button. πβ¨pathName delete indexβ Deletes the button given byindexfrom the button box. bye bestie πpathName hide indexβ Hides the button denoted byindex. This doesn't remove the button permanently, just inhibits its display. not gone, just shy πpathName index indexβ Returns the numerical index corresponding toindex. π’pathName insert index tag ?option value option value ...?β Same as theaddcommand except it inserts the new button just before the one given byindex, instead of appending to the end of the button box. Theoptionandvaluearguments mean the same thing as they do for theaddwidget command. πΈpathName invoke ?index?β Invoke the command associated with a button. If no arguments are given, the current default button is invoked; otherwise the argument is expected to be a button index. π₯pathName show indexβ Display a previously hidden button denoted byindex. comeback szn π¦
π EXAMPLE π
package require Iwidgets 4.0
iwidgets::buttonbox .bb
.bb add Yes -text Yes -command "puts Yes"
.bb add No -text No -command "puts No"
.bb add Maybe -text Maybe -command "puts Maybe"
.bb default Yes
pack .bb -expand yes -fill both
three buttons, one of them is the default, and the whole thing packs itself with -expand yes -fill both. iconic honestly.
π AUTHOR π
Bret A. Schuhmacher Mark L. Ulferts
β KEYWORDS β
buttonbox, pushbutton, button, widget
and that's the whole page bestie!! this one ships from the Tk crew, so shoutout to Tk for keeping iwidgets::buttonbox alive and thriving π go forth and build the cutest button box the terminal has ever seen β¨ππ¦
π¦ where this page comes from
- debian bookworm: iwidgets4-doc 4.1.1-2.1
- debian trixie: iwidgets4-doc 4.1.1-4
- ubuntu jammy: iwidgets4-doc 4.1.1-2.1
- ubuntu noble: iwidgets4-doc 4.1.1-2.1
- ubuntu resolute: iwidgets4-doc 4.1.1-4
- ubuntu stonking: iwidgets4-doc 4.1.1-4
- Copyright (c) 1995 DSC Technologies Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms