tixSelect(n)
π tixSelect(n) β the Tix Built-In Commands one, babes
okay so welcome to tixSelect, bestie. this is one of those Tix built-in commands and it's genuinely iconic once you get it. she's a container widget, she holds buttons, she has opinions about how many of them can be selected at once. let's go π
β¨ NAME β¨
tixSelect β creates and manipulates tixSelect widgets. that's it, that's the whole name section, and honestly? she ate.
π¦ SYNOPSIS π¦
tixSelect pathName ?options?
π SUPER-CLASS π
the TixSelect class is derived from the TixLabelWidget class, and it inherits all the commands, options and subwidgets of its super-class. so anything TixLabelWidget can do, she can do too. nepotism? no, inheritance. π
π STANDARD OPTIONS π
the Select widget supports all the standard options of a frame widget. for the details on the standard options, go read the options(n) manual entry β she's not repeating all of that here, no cap.
π WIDGET-SPECIFIC OPTIONS π
these are her own personal flags. main character energy only.
-allowzeroallowZero β a boolean value that says whether the selection is allowed to be empty. when it's set to false, at least one button subwidget has to be selected at any time.
β οΈ okay this note is important: when the Select widget is first constructed, the default selection is always empty, even if -allowzero is set to false. literally always. don't come for her, that's just how she arrives. π
-buttontypebuttonType β the type of buttons used as subwidgets inside the Select widget. by default, the standard Tk button widget class is used.-commandcommand β specifies the TCL command to be executed when the-valueof the Select widget is changed. this command gets invoked with two arguments: the first is the name of the button subwidget that has toggled, and the second is a boolean value indicating whether that button subwidget is selected. and pssst β this command is only executed when the-disableCallbackoption is set to false.-disablecallbackdisableCallback β a boolean value indicating whether callbacks should be disabled. when set to true, the TCL command specified by-commandis not executed when the-valueof the Select widget changes. she's on do-not-disturb mode π«Ά-orientationβ the orientation of the button subwidgets.- Name:
orientation - Class:
Orientation - Switch:
-orientation - Alias:
-orient
- Name:
only the values horizontal and vertical are recognized. this is a static option and it can only be assigned during the creation of the widget. so decide early, bestie, she's not changing for you later π
-labellabel β specifies the string to display as the label of this Select widget.-labelsidelabelSide β specifies where the label should be displayed relative to the Select widget. valid options are:top,left,right,bottom,noneoracrosstop.-padxpadX β specifies the horizontal padding between two neighboring button subwidgets. this is a static option and it can only be assigned during the creation of the widget.-padxpadY β specifies the vertical padding between two neighboring button subwidgets. this is a static option and it can only be assigned during the creation of the widget. (yes, the page literally spells it-padxwithpadYβ i'm copying it character for character, do not perceive me π)-radioradio β a boolean value that says whether the Select widget should act as a radio-box. when set to true, at most one button subwidget can be selected at any time. this is a static option and it can only be assigned during the creation of the widget.-selectedbgselectedBg β specifies the background color of all the selected button subwidgets. the chosen ones get a whole new lewk β¨-statestate β specifies the state of all the buttons inside the Select widget. only the valuesnormalanddisabledare recognized. when the state is set todisabled, all user actions on this Select widget are ignore. (their words, and the vibe is clear: don't touch her, she's resting π΄)-validatecmdvalidateCmd β specifies a TCL command to be called when the-valueof the Select widget is about to change. this command is called with one parameter β the new-valueentered by the user. this command is to validate this new value by returning a value it deems valid. she's the bouncer at the door fr fr πͺ-valuevalue β the value of a Select widget is a list of the names of the button subwidgets that have been selected by the user.
when you assign the value of a Select widget using the config -value widget command, the TCL command specified by the -command option will be invoked if some button subwidgets are toggled. iykyk.
-variablevariable β specifies the global variable in which the value of the Select widget should be stored. the value of a Select widget is stored as a list of the names of the button subwidgets that have been selected by the user. the value of the Select widget will be automatically updated when this variable is changed. she's synced, she's linked, she's in her connected era π¦
π SUBWIDGETS π
- Name:
label - Class:
Label
the label subwidget. that's her. π
in addition, all the button subwidgets created as a result of the add widget command can be accessed by the subwidget command. they're identified by the buttonName parameter to the add widget command. here's an example so you can literally see it:
set s [tixSelect .s]
pack $s
$s add eat -text Eat
$s add sleep -text Sleep
$s subwidget eat config -fg green
$s subwidget sleep config -fg red
see how eat gets green and sleep gets red? that's the whole trick. adorable, honestly. π
πΈ DESCRIPTION πΈ
the tixSelect command creates a new window (given by the pathName argument) and makes it into a Select widget. additional options, described above, may be specified on the command line or in the option database to configure aspects of the Select widget such as its cursor and relief.
the Select widget is a container of button subwidgets. it can be used to provide radio-box or check-box style of selection options for the user. so think of her as the friend group chat and the buttons as the members β except here you actually control who's active π
β WIDGET COMMANDS β
the tixSelect command creates a new Tcl command whose name is the same as the path name of the Select widget's window. this command may be used to invoke various operations on the widget. general form, bestie:
pathName option ?arg arg ...?
PathName is the name of the command, which is the same as the Select widget's path name. Option and the args determine the exact behavior of the command. the following commands are possible for Select widgets:
pathName add buttonName ?option value ... ?β adds a new button subwidget with the name buttonName into the Select widget. additional configuration options can be given to configure the new button subwidget. new friend incoming π«ΆpathName cget optionβ returns the current value of the configuration option given by option. option may have any of the values accepted by thetixSelectcommand.pathName configure ?option? ?value option value ...?β query or modify the configuration options of the widget. if no option is specified, returns a list describing all of the available options for pathName (seeTk_ConfigureInfofor information on the format of this list). if option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). 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. option may have any of the values accepted by thetixSelectcommand. she's flexible like that πββοΈpathName invoke buttonNameβ invokes the button subwidget with the name buttonName. yep, you can just press her programmatically. iconic.pathName subwidget name ?args?β when no options are given, returns the pathname of the subwidget of the specified name.
when options are given, the widget command of the specified subwidget will be called with these options. so you can reach straight into a subwidget and configure it, no middleman π§
π BINDINGS π
when the user presses the left mouse button over the a button subwidget, it will be toggled and the -value option of the tixSelect widget will be changed. one click, one toggle, one changed value. simple as that, periodt. π±οΈ
π₯ EXAMPLE π₯
the following example creates a radio-box style iconbar for the user to choose one value among eat, work or sleep. the eternal trio, honestly π
set s [tixSelect .s -radio true -allowzero false]
$s add eat -bitmap [tix getbitmap eat]
$s add work -bitmap [tix getbitmap work]
$s add sleep -bitmap [tix getbitmap sleep]
π§ KEYWORDS π§
Tix(n), Container Widget
<div align=center>π β¨ π π¦ πΈ π π«Ά </div>
and that's the whole page, bestie, you're officially fluent in tixSelect. this one comes from Tix, version 4.0, and yeah she's an oldie but she's still serving. mwah π β Tix 4.0 tixSelect(n)
π¦ where this page comes from
- opensuse-leap 16.0: tix 8.4.3-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: tix 8.4.3-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: tix 8.4.3-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: tix 8.4.3-160000.2.2 Β· BSD-3-Clause
- Copyright (c) 1993-1999 Ioi Kim Lam
- Copyright (c) 2000-2001 Tix Project Group
- (c) 1990 The Regents of the University of California
- (c) 1994-1995 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms