iwidgets::radiobox(1)

πŸ’– iwidgets::radiobox β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to iwidgets::radiobox(1), part of [incr Widgets] β€” yes the manpage name is literally right there in the title, we love a self-aware icon πŸ’…


✨ NAME ✨

iwidgets::radiobox β€” create and manipulate a radiobox widget. that's it, that's the whole job, and it does it gorgeously πŸŽ€


🌸 SYNOPSIS 🌸

iwidgets::radiobox pathName ?options?

πŸ¦‹ INHERITANCE πŸ¦‹

the family tree, and it's giving royal bloodline πŸ‘‘

itk::Widget <- iwidgets::Labeledframe <- iwidgets::Radiobox

🌈 STANDARD OPTIONS 🌈

these come with the standard-options package deal, no extra charge:

  • background
  • borderWidth
  • cursor
  • disabledForeground
  • foreground
  • relief
  • selectColor
heads up bestie β€” go read the "options" manual entry for the full tea on all of these β˜•

πŸ’œ INHERITED OPTIONS πŸ’œ

these got passed down from the ancestors (the labeledframe class, to be exact):

  • labelBitmap
  • labelFont
  • labelImage
  • labelMargin
  • labelPos
  • labelText
  • labelVariable
see the "labeledframe" class manual entry for the deets on these inherited ones πŸ’–

πŸ‘‘ WIDGET-SPECIFIC OPTIONS πŸ‘‘

these are the main-character options, the ones that make a radiobox a radiobox:

  • -command β€” Name: command, Class: Command, Command-Line Switch: -command

this is a Tcl command procedure that gets evaluated right after the current radio box selection changes. so like, the callback. the "and then what" ✨

  • -orient β€” Name: orient, Class: Orient, Command-Line Switch: -orient, Default Value: vertical

controls the orientation of the radiobuttons inside the radiobox. valid values are either "horizontal" or "vertical". that's the whole vibe check, pick one 🧚


🌟 DESCRIPTION 🌟

the iwidgets::radiobox command creates a radio button box widget. and this widget is capable β€” it can add, insert, delete, select, and configure radiobuttons, and it can also hand you back the currently selected button. multitasking queen 🫢


πŸ’« METHODS πŸ’«

so iwidgets::radiobox creates a brand new Tcl command, and its name is pathName. you use that command to invoke all kinds of operations on the widget. general form:

pathName option ?arg arg ...?

option and the args decide exactly what the command does. no cap.

a bunch of the widget commands for the radiobox take one argument that says which radiobutton of the radiobox we're operating on. these indicators are called indexes, and they let you reference and manipulate radiobuttons. radiobox indexes can be given in any of these forms:

  • number β€” specifies the radiobutton numerically, where 0 corresponds to the top radiobutton of the radiobox. zero-indexed, we respect that πŸ™ˆ
  • end β€” indicates the last radiobutton of the radiobox. iconic closer energy.
  • pattern β€” if the index doesn't satisfy either of the forms above, then this form is used. pattern gets pattern-matched against the tag of each radiobutton in the radiobox, in order from top to bottom, until a matching entry is found. the rules of Tcl_StringMatch are used. very detective, very slay πŸ”

πŸ”₯ WIDGET-SPECIFIC METHODS πŸ”₯

  • pathName add tag ?option value option value? β€” adds a new radiobutton to the radiobuttond window on the bottom. the command takes additional options which get passed on to the radiobutton as construction arguments β€” these include the standard Tk radiobutton options. the tag is returned. πŸ’–
  • pathName buttonconfigure index ?options? β€” this one is similar to the configure command, except it applies to the options for an individual radiobutton, whereas configure applies to the options for the radiobox as a whole. options may have any of the values accepted by the add widget command. if options are specified, the options are modified as indicated in the command and the command returns an empty string. if no options are specified, it returns a list describing the current options for entry index (see Tk_ConfigureInfo for info on the format of this list). πŸŽ€
  • 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::radiobox command.
  • 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 info on the format of this list). if option is specified with no value, then the command returns a list describing that one named option (this list will be identical to the corresponding sublist of the value returned if no option was 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::radiobox command. πŸ’…
  • pathName delete index β€” deletes a specified radiobutton given an index. bye bestie πŸ‘‹
  • pathName deselect index β€” deselects a specified radiobutton given an index.
  • pathName flash index β€” flashes a specified radiobutton given an index. dramatic on purpose ✨
  • pathName get β€” returns the tag of the currently selected radiobutton.
  • pathName index index β€” returns the numerical index corresponding to index.
  • pathName insert index tag ?option value option value ...? β€” same as the add command, except that it inserts the new radiobutton just before the one given by index, instead of appending to the end of the radiobox. the option and value arguments have the same interpretation as for the add widget command.
  • pathName select index β€” selects a specified radiobutton given an index. the chosen one. main character. πŸ‘‘

πŸ“ EXAMPLE πŸ“

here's the whole thing in action, and yes it eats:

package require Iwidgets 4.0
iwidgets::radiobox .rb -labeltext Fonts
.rb add times -text Times
.rb add helvetica -text Helvetica
.rb add courier -text Courier
.rb add symbol -text Symbol
.rb select courier

pack .rb -padx 10 -pady 10 -fill both -expand yes

look at courier getting selected at the end. taste. 😌


πŸ’œ AUTHOR πŸ’œ

  • Michael J. McLennan
  • Mark L. Ulferts

(legends, honestly 🫢)


🌸 KEYWORDS 🌸

radiobox, widget


and that's the whole page bestie!! πŸ’– this one lives under the Tk source, page iwidgets::radiobox(1) β€” so go forth, build your radioboxes, select things, flash things, and remember: zero is the top radiobutton, end is the last one, and patterns match tags from top to bottom. periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from