tixComboBox(n)

πŸ“¦ version 8.4.3, in opensuse-leap 16.0

πŸŽ€ 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 ✨

  • -anchor anchor β€” 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 πŸ’«
  • -arrowbitmap arrowBitmap β€” 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 πŸŽ€
  • -browsecmd browseCmd β€” 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 πŸ‘€
  • -command command β€” the command to be called when the ComboBox is invoked or when the -value of the ComboBox is changed. the main-character callback, fr fr πŸ”₯
  • -crossbitmap crossBitmap β€” 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 βœ–οΈ
  • -disablecallback disableCallback β€” a boolean value indicating whether callbacks should be disabled. when set to true, the TCL command specified by the -command option is not executed when the -value of the ComboBox changes. quiet mode: activated 🀫
  • -disabledforeground disabledforeground β€” the foreground color to be used when the ComboBox is disabled. gotta look cute even when you’re off duty πŸ’…
  • -dropdown dropdown β€” 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 πŸ‘‘
  • -editable editable β€” specifies whether the user is allowed to type into the entry subwidget of the ComboBox. type or don’t type, that is the question ✍️
  • -fancy fancy β€” a Boolean value specifying whether the cross and tick button subwidgets should be shown. fancy mode is literally in the name πŸ’–
  • -grab grab β€” 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

Specifies how many previous user inputs can be stored in the history list. four labels for one option, we don’t ask questions πŸ’€

  • -history history β€” a Boolean value specifying whether previous user inputs should be stored in the history list. memory retention, but make it widget lore 🧠
  • -label label β€” the string to display as the label of this ComboBox widget. name tag, but glamorous 🏷️
  • -labelside labelSide β€” where the label should be displayed relative to the entry subwidget. valid options are: top, left, right, bottom, none or acrosstop. label placement is a whole aesthetic ✨
  • -listcmd listCmd β€” 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 πŸ¦‹
  • -listwidth listWidth β€” 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 πŸ“
  • -prunehistory prunehistory β€” specifies whether duplicated previous user inputs should be pruned from the the history list. only Boolean values are allowed. declutter the archive 🧹
  • -selection selection β€” (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 -selection twice in this manual page, and yes, we are keeping both πŸ’…
  • -selection selection β€” (the second one, literally another -selection bullet) 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 -selection option. the -value option is updated only when the user presses the return key. temporary vibes, permanent consequences ⌨️
  • -selectmode selectMode β€” how the combobox responds to the mouse button events in the listbox subwidget; can either be "browse" or "immediate". the default -selectmode is "browse". see the BINDINGS section below. click behavior has lore, go read it πŸ–±οΈ
  • -state state β€” whether the ComboBox is normal or disabled. only the values "normal" and "disabled" are recognized. on or off, no in-between πŸŒ—
  • -tickbitmap tickBitmap β€” 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 βœ…
  • -validatecmd validateCmd β€” a TCL command to be called when the -value of the ComboBox is about to change. this command is called with one parameter -- the new -value entered by the user. this command is to validate this new value by returning a value it deems valid. the vibe check before the commit 🚦
  • -value value β€” 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 -value option is changed as a result of the config -value widget command, the TCL command specified by the -command option is called. the actual chosen one πŸ‘‘
  • -variable variable β€” 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 -fancy is set. βœ–οΈ
  • Name: entry β€” Class: Entry. the entry that shows the value of this tixControl. (yes, the original says tixControl right 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 -fancy is 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 the string to the beginning of the listbox. fresh at the front πŸ“
  • pathName appendhistory string β€” append the string to 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 by option. option may have any of the values accepted by the tixComboBox command. ask and she shall tell πŸ’¬
  • 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 (see Tk_ConfigureInfo for 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 the tixComboBox command. the config command is basically the group-chat admin panel, no cap βš™οΈ
  • pathName flash index string β€” flashes the ComboBox. flash is usually called by a -command procedure to acknowledge to the user that they have selected a value for the ComboBox. little visual hype moment, obsessed ✨
  • pathName insert index string β€” insert the string into the listbox at the specified index. index must 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 -command option 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:

  1. if your -selectmode is "immediate", then the second the user enters a keystroke, clicks on an item, or drags the mouse pointer in the listbox β€” boom β€” the -value of the ComboBox is immediately set to that item, and the -command procedure gets called. like, no hesitation. she commits. πŸ”₯
  2. if your -selectmode is "browse", then when the user enters a keystroke, clicks on an item, or drags the mouse pointer in the listbox, the -selection of the ComboBox is immediately set to the new content of the entry subwidget, and also the -browsecmd procedure is called. the -value option 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 -selection is just ignored 😌 and the text inside the entry subwidget gets restored to the current -value of the ComboBox. escape = undo, basically. iconic.
  3. if the -dropdown option is true, the user can invoke the ComboBox by releasing the left mouse button over the desired item in the listbox. if the -dropdown option 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 from Tix vetsion 4.0 (that spelling is straight from the manpage, don't come for me 😭), the default -value of the ComboBox is the empty string. so if you want your ComboBox to show a string by default, you must configure its -value option 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