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:

  • activeBackground
  • background
  • borderWidth
  • cursor
  • exportSelection
  • foreground
  • highlightColor
  • highlightThickness
  • insertBackground
  • insertBorderWidth
  • insertOffTime
  • insertOnTime
  • insertWidth
  • relief
  • repeatDelay
  • repeatInterval
  • selectBackground
  • selectBorderWidth
  • selectForeground

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

  • textBackground
  • textFont

See the "entryfield" widget class manual entry for details on the above associated options.

🌈 from the labeledwidget class

  • labelFont
  • labelMargin

See the "labeledwidget" class manual entry for details on the above associated options.

⭐ from the scrollbar widget class

  • activeRelief
  • elementBorderWidth
  • jumptroughColor

See the "scrollbar" widget class manual entry for details on the above associated options.

πŸ”₯ from the scrolledlistbox widget class

  • dblClickCommand
  • hscrollMode
  • sbWidth
  • scrollMargin
  • textBackground
  • textFont
  • vscrollMode

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 is center.
  • 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 to Tk_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, or nw. The default is nw.
  • itemsOn (Class: ItemsOn, command-line switch: -itemson) β€” Specifies whether or not to display the items list in any of the forms acceptable to Tcl_GetBoolean. The default is true.
  • margin (Class: Margin, command-line switch: -margin) β€” Specifies distance between the items list and selection entry in any of the forms acceptable to Tk_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, or nw. The default is nw.
  • selectionOn (Class: SelectionOn, command-line switch: -selectionon) β€” Specifies whether or not to display the selection entry in any of the forms acceptable to Tcl_GetBoolean. The default is true.
  • 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 to Tk_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:

  • curselection
  • delete
  • index
  • nearest
  • scan
  • selection
  • size

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 by option. Option may have any of the values accepted by the iwidgets::selectionbox command.
  • pathName childsite β€” Returns the child site widget path name.
  • pathName clear component β€” Delete the contents of either the selection entry widget or items list. The component argument may be either items or selection.
  • 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 iwidgets::selectionbox command.
  • 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. The component argument may be either items or selection. The args follow the rules of either an entry or list widget depending on the component value.
  • 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) β€” The childsite component is the user child site for the selection box. See the "frame" widget manual entry for details on the childsite component item.
  • items (Class: Scrolledlistbox) β€” The items component provides the scrolled list box of items for the selection box. See the "scrolledlistbox" widget manual entry for details on the items component item.
  • selection (Class: Entryfield) β€” The selection component provides the entry field in the selection box for display of the selected item in the items component. See the "entryfield" widget manual entry for details on the selection component 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 πŸ”‘

  • selectionbox
  • widget

πŸ’€ 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