iwidgets::checkbox(1)

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

okay bestie, welcome to the iwidgets::checkbox(1) page from [incr Widgets]. this is a section 1 manual entry, it's giving very Tk, very iconic, and we're gonna walk through the whole thing together. no skimming, no skipping, we're doing every last option. periodt. πŸ’…


✨ NAME ✨

iwidgets::checkbox β€” creates and manipulates a checkbox widget. that's it, that's the vibe. a whole little box of checkbuttons and you're the main character controlling all of them. πŸŽ€


✨ SYNOPSIS ✨

iwidgets::checkbox pathName ?options?

πŸ¦‹ INHERITANCE πŸ¦‹

the family tree, and she's got range:

itk::Widget <- iwidgets::Labeledframe <- iwidgets::Checkbox

🌸 STANDARD OPTIONS 🌸

these are the classic ones, inherited from the ancestors, nothing new under the sun:

  • background
  • borderWidth
  • cursor
  • disabledForeground
  • foreground
  • relief
  • selectColor
lowkey if you wanna know what these do, go read the options manual entry. it's all in there, iykyk. πŸ“–

πŸŽ€ INHERITED OPTIONS πŸŽ€

these ones came from the labeledframe side of the family:

  • labelBitmap
  • labelFont
  • labelImage
  • labelMargin
  • labelPos
  • labelText
  • labelVariable
for the full tea on these, check the labeledframe class manual entry. she explains everything. πŸ’œ

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

okay these are the ones that are hers, unique to checkbox, no cap.

  • -command β€” Name: command, Class: Command. this is a Tcl command procedure that gets evaluated right after the current check box selection changes. so like, you pick a thing, and boom, your command runs. ✨
  • -orient β€” Name: orient, Class: Orient, Default Value: vertical. this sets the orientation of the checkbuttons inside the checkbox. valid values are either "horizontal" or "vertical". and yeah, the default is vertical, so they stack by default. 🫢

πŸ’– DESCRIPTION πŸ’–

the iwidgets::checkbox command creates a check button box widget that is fully capable of adding, inserting, deleting, selecting, and configuring checkbuttons, plus it can hand you the currently selected button. it's giving multitasker. it's giving organized. we stan. πŸ’…


🌈 METHODS 🌈

so when you run iwidgets::checkbox, it creates a brand new Tcl command whose name is pathName. you use that command to do literally everything to the widget. the general form is:

pathName option ?arg arg ...?

option and the args are what decide the exact behavior of the command. simple as that, bestie. 🧚


πŸ“ Indexes πŸ“

a lot of the widget commands for the checkbox take one argument that says which checkbutton of the checkbox you're operating on. these are called indexes, and they let you reference and manipulate individual checkbuttons. you can write a checkbox index in any of these forms:

  • number β€” specifies the checkbutton numerically, where 0 corresponds to the top checkbutton of the checkbox. so yeah, counting from zero, as the elders intended. πŸ”’
  • end β€” indicates the last checkbutton of the checkbox. the final girl. the last one standing. 🌟
  • pattern β€” if the index doesn't satisfy one of the forms above, then this form is used. pattern is pattern-matched against the tag of each checkbutton in the checkbox, in order from top to bottom, until a matching entry is found. the rules of Tcl_StringMatch are used. so it's a little scavenger hunt down the list. πŸ”

⭐ WIDGET-SPECIFIC METHODS ⭐

here we go, the whole menu, every single one:

  • pathName add tag ?option value option value? β€” adds a new checkbutton to the checkbutton window on the bottom. the command takes additional options which are passed on to the checkbutton as construction arguments. these include the standard Tk checkbutton options. the tag is returned. 🎁
  • pathName buttonconfigure index ?options? β€” this command is similar to the configure command, except that it applies to the options for an individual checkbutton, whereas configure applies to the options for the checkbox as a whole. options may have any of the values accepted by the add widget command. if options are specified, options are modified as indicated in the command and the command returns an empty string. if no options are specified, returns a list describing the current options for entry index (see Tk_ConfigureInfo for information 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::checkbox 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 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::checkbox command. πŸ’«
  • pathName delete index β€” deletes a specified checkbutton given an index. bye bestie. πŸ‘‹
  • pathName deselect index β€” deselects a specified checkbutton given an index. unchecking, we love to see it. πŸ™ˆ
  • pathName flash index β€” flashes a specified checkbutton given an index. dramatic lil moment, iconic. ⚑
  • pathName get ?index? β€” returns the tags of the currently selected checkbuttons, or the selection status of a specific checkbutton when given an index. πŸ“‹
  • 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 checkbutton just before the one given by index, instead of appending to the end of the checkbox. the option and value arguments have the same interpretation as for the add widget command. πŸͺ„
  • pathName select index β€” selects a specified checkbutton given an index. yes queen, checked. βœ…

πŸ¦‹ EXAMPLE πŸ¦‹

here's the whole thing in action, copy it, run it, slay:

package require Iwidgets 4.0
iwidgets::checkbox .cb -labeltext Styles
.cb add bold -text Bold
.cb add italic -text Italic
.cb add underline -text Underline
.cb select underline

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

look at her go. πŸ’–


🌸 AUTHOR 🌸

John A. Tucker β€” the original icon, we thank her for her service. 🫢


πŸ’œ KEYWORDS πŸ’œ

checkbox, widget


and that's the whole page bestie!! you ate that. this manual entry comes to you from the Tk source, and it's the iwidgets::checkbox(1) page, section 1, no cap. now go check some boxes. πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from