tixComboBox(n)
π tixComboBox(n) β Tix Built-In Commands π
okay bestie, welcome to the tixComboBox manual page β yes, the Tix Built-In Commands one β and no, we are not skipping a single flag. this widget is basically the βpick a thing or type a thingβ queen of Tix, and she has so many options. letβs get into it π
πΈ NAME πΈ
tixComboBox β Create and manipulate tixComboBox widgets. thatβs the whole name section, short and iconic β¨
π¦ SYNOPSIS π¦
tixComboBox pathName ?options?
π SUPER-CLASS π
The TixComboBox class is derived from the TixLabelWidget class, and it inherits all the commands, options, and subwidgets of its super-class. no cap, it gets the whole inheritance package π«Ά
π STANDARD OPTIONS π
TixComboBox supports all the standard options of a frame widget. peek at the options(n) manual entry for the details on those standard options β thatβs where the frame-level lore lives, iykyk π
β¨ WIDGET-SPECIFIC OPTIONS β¨
-anchoranchor β controls how the string inside the entry subwidget is aligned. only the values"w"or"e"are allowed. set it to"w"and the entry is aligned to its beginning; set it to"e"and itβs aligned to its end. left or right, pick your vibe π«-arrowbitmaparrowBitmap β the bitmap used in the arrow button beside the entry widget. the default is a downward arrow bitmap in the file$tix_library/bitmaps/cbxarrow. adorable and functional π-browsecmdbrowseCmd β the command to be called when the user browses through the listbox. this one is for instant feedback while the user examines items in the listbox before committing a choice. so observant, so responsive π-commandcommand β the command to be called when the ComboBox is invoked or when the-valueof the ComboBox is changed. the main-character callback, fr fr π₯-crossbitmapcrossBitmap β the bitmap used in the βcrossβ button to the left of the entry widget. the default is a bitmap in the file$tix_library/bitmaps/cross. cross button supremacy βοΈ-disablecallbackdisableCallback β a boolean value indicating whether callbacks should be disabled. when set to true, the TCL command specified by the-commandoption is not executed when the-valueof the ComboBox changes. quiet mode: activated π€«-disabledforegrounddisabledforeground β the foreground color to be used when the ComboBox is disabled. gotta look cute even when youβre off duty π-dropdowndropdown β a Boolean value specifying the style of the ComboBox. when set to"true", the listbox is only displayed temporarily when the arrow button is pressed. when set to"false", the listbox is always displayed. pop-up queen or always-on queen, your choice π-editableeditable β specifies whether the user is allowed to type into the entry subwidget of the ComboBox. type or donβt type, that is the question βοΈ-fancyfancy β a Boolean value specifying whether the cross and tick button subwidgets should be shown. fancy mode is literally in the name π-grabgrab β the pointer grabbing policy when the listbox is popped up. only the values"global","local"or"none"are allowed. by default, global grab is used. however, when you are developing your application, you may want to use only local grabbing so that in the event of errors, your X display wonβt be locked up. protective queen behavior, tbh π‘οΈ-historylimitβ the history-limit option, and it has a whole little identity card:- Name:
historyLimit - Class:
historyLimit - Switch:
-historylimit - Alias:
-histlimit
- Name:
Specifies how many previous user inputs can be stored in the history list. four labels for one option, we donβt ask questions π
-historyhistory β a Boolean value specifying whether previous user inputs should be stored in the history list. memory retention, but make it widget lore π§-labellabel β the string to display as the label of this ComboBox widget. name tag, but glamorous π·οΈ-labelsidelabelSide β where the label should be displayed relative to the entry subwidget. valid options are:top,left,right,bottom,noneoracrosstop. label placement is a whole aesthetic β¨-listcmdlistCmd β a TCL command to be called every time the listbox pops up. this option lets you fill up the listbox on-demand. itβs ignored when the listbox is not in the dropdown style. lazy-loading, but make it iconic π¦-listwidthlistWidth β if set, this option controls the width of the listbox subwidget when it is popped up. the option is ignored when the listbox is not in the dropdown style. width matters, bestie π-prunehistoryprunehistory β specifies whether duplicated previous user inputs should be pruned from the the history list. only Boolean values are allowed. declutter the archive π§Ή-selectionselection β (the first one) contains the selection in the ComboBox (the string displayed in the entry subwidget). depending on the-selectmode, the selection of a ComboBox may be different than its-value. yes, they said-selectiontwice in this manual page, and yes, we are keeping both π-selectionselection β (the second one, literally another-selectionbullet) this option stores the temporary selection. when the user types in a text string inside the entry widget, that string is considered as a temporary input and is stored inside the-selectionoption. the-valueoption is updated only when the user presses the return key. temporary vibes, permanent consequences β¨οΈ-selectmodeselectMode β how the combobox responds to the mouse button events in the listbox subwidget; can either be"browse"or"immediate". the default-selectmodeis"browse". see the BINDINGS section below. click behavior has lore, go read it π±οΈ-statestate β whether the ComboBox is normal or disabled. only the values"normal"and"disabled"are recognized. on or off, no in-between π-tickbitmaptickBitmap β the bitmap used in the βtickβ button to the left of the entry widget. the default is a bitmap in the file$tix_library/bitmaps/tick. tick button, doing the most and we love her β-validatecmdvalidateCmd β a TCL command to be called when the-valueof the ComboBox 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. the vibe check before the commit π¦-valuevalue β the string to be displayed in the entry subwidget of the ComboBox. when queried, the returned value is the last value selected by the user. when the-valueoption is changed as a result of theconfig -valuewidget command, the TCL command specified by the-commandoption is called. the actual chosen one π-variablevariable β the global variable in which the value of the ComboBox should be stored. the value of the ComboBox will be automatically updated when this variable is changed. linked, synced, slaying π
π¦ SUBWIDGETS π¦
- Name:
arrowβ Class:Button. the down arrow button. β¬οΈ - Name:
crossβ Class:Button. the cross button. available only when-fancyis set. βοΈ - Name:
entryβ Class:Entry. the entry that shows the value of thistixControl. (yes, the original saystixControlright there β weβre keeping it, iconic behavior π) - Name:
labelβ Class:Label. the label subwidget. π·οΈ - Name:
listboxβ Class:Listbox. the listbox that holds all the list entries. π - Name:
slistboxβ Class:TixScrolledListBox. the scrolled-listbox that provides the scrollbars. scrolling with support π - Name:
tickβ Class:Button. the tick button. available only when-fancyis set. β
πΈ DESCRIPTION πΈ
The tixComboBox command creates a new window (given by the pathName argument) and makes it into a tixComboBox widget. additional options, described above, may be specified on the command line or in the option database to configure aspects of the ComboBox such as its cursor and relief. very βmake it yoursβ energy π
The Tix ComboBox widget is similar to the combo box control in MS Windows. the user can select a choice by either typing in the entry subwdget or selecting from the listbox subwidget. two paths to the same slay π«Ά
π WIDGET COMMANDS π
The tixComboBox command creates a new Tcl command whose name is the same as the path name of the ComboBoxβs window. this command may be used to invoke various operations on the widget. it has the following general form:
pathName option ?arg arg ...?
pathName is the name of the command, which is the same as the ComboBox widgetβs path name. option and the args determine the exact behavior of the command. the following commands are possible for ComboBox widgets:
pathName addhistory stringβ add thestringto the beginning of the listbox. fresh at the front πpathName appendhistory stringβ append thestringto the end of the listbox. no cutting the line, just adding to it πpathName cget optionβ returns the current value of the configuration option given byoption.optionmay have any of the values accepted by thetixComboBoxcommand. ask and she shall tell π¬pathName configure ?option? ?value option value ...?β query or modify the configuration options of the widget. if nooptionis specified, returns a list describing all of the available options forpathName(seeTk_ConfigureInfofor information on the format of this list). ifoptionis specified with novalue, 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 nooptionis 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.optionmay have any of the values accepted by thetixComboBoxcommand. the config command is basically the group-chat admin panel, no cap βοΈpathName flash index stringβ flashes the ComboBox.flashis usually called by a-commandprocedure to acknowledge to the user that they have selected a value for the ComboBox. little visual hype moment, obsessed β¨pathName insert index stringβ insert thestringinto the listbox at the specifiedindex.indexmust be a valid listbox index. right place, right time πpathName pick indexβ set the(index)th item in the listbox to be the current value of the ComboBox. as a result, the value of the ComboBox is changed and the TCL command specified by the-commandoption will be called. picking is committing, bestie β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. subwidget access, unlocked π
okay thatβs part 1, bestie β part 2 is literally right after this, keep scrolling ππ«Ά
π BINDINGS π
ok so this is the part where we talk about what actually happens when your fingers touch stuff π
the ComboBox is very sensitive bestie, she reacts to literally everything, and the exact reaction depends on your -selectmode and -dropdown settings. let's break it down:
- if your
-selectmodeis"immediate", then the second the user enters a keystroke, clicks on an item, or drags the mouse pointer in the listbox β boom β the-valueof the ComboBox is immediately set to that item, and the-commandprocedure gets called. like, no hesitation. she commits. π₯ - if your
-selectmodeis"browse", then when the user enters a keystroke, clicks on an item, or drags the mouse pointer in the listbox, the-selectionof the ComboBox is immediately set to the new content of the entry subwidget, and also the-browsecmdprocedure is called. the-valueoption only changes when the user actually invokes the ComboBox (scroll down to[3]for that π). and here's the cozy safety net: if the user presses the Escape key at any time, any new-selectionis just ignored π and the text inside the entry subwidget gets restored to the current-valueof the ComboBox. escape = undo, basically. iconic. - if the
-dropdownoption is true, the user can invoke the ComboBox by releasing the left mouse button over the desired item in the listbox. if the-dropdownoption is false, they invoke it by double-clicking over the desired item in the listbox. and in both cases π«Ά the user can also invoke the listbox by pressing the Return or Tab key inside the entry subwidget, or by switching the input focus to another widget inside the same toplevel widget. keyboard girlies stay winning β¨οΈβ¨
π BUGS π
ok so this one's real, pay attention bestie:
starting fromTix vetsion 4.0(that spelling is straight from the manpage, don't come for me π), the default-valueof the ComboBox is the empty string. so if you want your ComboBox to show a string by default, you must configure its-valueoption explicitly. no cap. she will show up empty otherwise and you'll be staring at a blank box like ποΈπποΈ
π KEYWORDS π
Tix(n), ComboBox(n), listbox(n)
and that's the whole page babes πΈ this lil slice of wisdom comes to you courtesy of Tix version 4.0, in the manual page tixComboBox(n) β go forth and build the prettiest dropdown the world has ever seen ππ mwah, bye! π¦
π¦ 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