iwidgets::selectionbox(1)
π iwidgets::selectionbox β the manual, but make it make sense β¨
okay bestie, so this is iwidgets::selectionbox(1) from the [incr Widgets] set β yes, the whole manual page, and yes, I'm gonna walk you through every single line of it because you deserve to know your tools. no gatekeeping here. π«Ά
πΈ NAME πΈ
iwidgets::selectionbox β Create and manipulate a selection box widget. that's the whole vibe. π
β¨ SYNOPSIS β¨
iwidgets::selectionbox pathName ?options?
π¦ INHERITANCE π¦
it's giving family tree, and the lineage is:
itk::Widget <- iwidgets::Selectionbox
so iwidgets::Selectionbox is the child of itk::Widget, periodt. π
π STANDARD OPTIONS π
these are the inherited classics, the ones every well-behaved widget shows up with:
activeBackgroundbackgroundborderWidthcursorexportSelectionforegroundhighlightColorhighlightThicknessinsertBackgroundinsertBorderWidthinsertOffTimeinsertOnTimeinsertWidthreliefrepeatDelayrepeatIntervalselectBackgroundselectBorderWidthselectForeground
See the "options" manual entry for details on the standard options. (iykyk, they're the usual suspects β¨)
π ASSOCIATED OPTIONS π
borrowed fits from the neighbors, and we love a collab:
π§ from the entryfield widget class
textBackgroundtextFont
See the "entryfield" widget class manual entry for details on the above associated options.
π from the labeledwidget class
labelFontlabelMargin
See the "labeledwidget" class manual entry for details on the above associated options.
β from the scrollbar widget class
activeReliefelementBorderWidthjumptroughColor
See the "scrollbar" widget class manual entry for details on the above associated options.
π₯ from the scrolledlistbox widget class
dblClickCommandhscrollModesbWidthscrollMargintextBackgroundtextFontvscrollMode
See the "scrolledlistbox" widget class manual entry for details on the above associated options.
π WIDGET-SPECIFIC OPTIONS π
these are the ones that are hers. main character options only. π
childSitePos(Class:Position, command-line switch:-childsitepos) β Specifies the position of the child site in the selection box:n,s,e,w, or.The default iscenter.height(Class:Height, command-line switch:-height) β Specifies the height of the selection box. The value may be specified in any of the forms acceptable toTk_GetPixels. The default is 320 pixels.itemsCommand(Class:Command, command-line switch:-itemscommand) β Specifies a command to be evaluated following selection of an item.itemsLabel(Class:Text, command-line switch:-itemslabel) β Specifies the text of the label for the items list. The default is"List".itemsLabelPos(Class:Position, command-line switch:-itemslabelpos) β Specifies the position of the label along the side of the items list:n,ne,e,se,s,sw,w, ornw. The default isnw.itemsOn(Class:ItemsOn, command-line switch:-itemson) β Specifies whether or not to display the items list in any of the forms acceptable toTcl_GetBoolean. The default istrue.margin(Class:Margin, command-line switch:-margin) β Specifies distance between the items list and selection entry in any of the forms acceptable toTk_GetPixels. The default is 7 pixels.selectionCommand(Class:Command, command-line switch:-selectioncommand) β Specifies a Tcl procedure to be associated with a return key press event in the selection entry field.selectionLabel(Class:Text, command-line switch:-selectionlabel) β Specifies the text of the label for the selection entry field. The default is"Selection".selectionLabelPos(Class:Position, command-line switch:-selectionlabelpos) β Specifies the position of the label along the side of the selection:n,ne,e,se,s,sw,w, ornw. The default isnw.selectionOn(Class:SelectionOn, command-line switch:-selectionon) β Specifies whether or not to display the selection entry in any of the forms acceptable toTcl_GetBoolean. The default istrue.width(Class:Width, command-line switch:-width) β Specifies the width of the selection box. The value may be specified in any of the forms acceptable toTk_GetPixels. The default is 260 pixels.
π DESCRIPTION π
The iwidgets::selectionbox command creates a scrolled list of items and a selection entry field. it's a two-for-one, and we're obsessed. π«Ά
so here's the tea: the user may choose any of the items displayed in the scrolled list of alternatives, and the selection field will be filled with the choice. the user is also free to enter a new value in the selection entry field. both the list and entry areas have labels. a child site is also provided in which the user may create other widgets to be used in conjunction with the selection box. built-in plus room to customize? iconic behavior. π
π§ METHODS π§
The iwidgets::selectionbox command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
Option and the args determine the exact behavior of the command. simple as that, bestie. β¨
π ASSOCIATED METHODS π
borrowed methods, still slaying:
curselectiondeleteindexnearestscanselectionsize
See the "listbox" widget class manual entry for details on the associated methods.
π« WIDGET-SPECIFIC METHODS π«
okay here's the actual toolkit, the moves she can do:
pathName cget optionβ Returns the current value of the configuration option given byoption.Optionmay have any of the values accepted by theiwidgets::selectionboxcommand.pathName childsiteβ Returns the child site widget path name.pathName clear componentβ Delete the contents of either the selection entry widget or items list. Thecomponentargument may be eitheritemsorselection.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 moreoption-valuepairs 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 theiwidgets::selectionboxcommand.pathName getβ Returns the current value of the selection entry widget.pathName insert component argsβ Insert element(s) into either the selection entry widget or items list. Thecomponentargument may be eitheritemsorselection. Theargsfollow the rules of either anentryorlistwidget depending on thecomponentvalue.pathName selectitemβ Replace the selection entry field contents with the currently selected items value.
π¦ COMPONENTS π¦
the ensemble cast, each with their own little class:
childsite(Class:Frame) β Thechildsitecomponent is the user child site for the selection box. See the"frame"widget manual entry for details on thechildsitecomponent item.items(Class:Scrolledlistbox) β Theitemscomponent provides the scrolled list box of items for the selection box. See the"scrolledlistbox"widget manual entry for details on theitemscomponent item.selection(Class:Entryfield) β Theselectioncomponent provides the entry field in the selection box for display of the selected item in theitemscomponent. See the"entryfield"widget manual entry for details on theselectioncomponent item.
π EXAMPLE π
here's a full little glow-up you can copy directly, no cap:
package require Iwidgets 4.0
option add *textBackground white
iwidgets::selectionbox .sb -items {Hello {Out There} World}
pack .sb -padx 10 -pady 10 -fill both -expand yes
set cs [label [.sb childsite].label -text "Child Site"]
pack $cs -fill x -padx 10 -pady 10
.sb insert items 2 {Cruel Cruel}
.sb selection set 1
π AUTHOR π
Mark L. Ulferts β thank you for your service, king. π«‘
π KEYWORDS π
selectionboxwidget
π reminder bestie: everything above is exactly what the original says. I just gave it a personality. don't come for me if you skip a flag and your widget misbehaves β read the options list, she's thorough for a reason. π
and that's the whole page, fr fr. this one came from the Tk crowd, the iwidgets::selectionbox(1) manual β that's the source and the version tag, right there in the footer, and I'm handing it to you with a lil bow on top. π go build something cute, bestie. β¨π¦π
π¦ 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