iwidgets::labeledwidget(1)
π iwidgets::labeledwidget β the manual, but make it cute π
okay bestie, welcome to the iwidgets::labeledwidget(1) page, filed under [incr Widgets], section 1, Tk family. it's giving base class energy and honestly? iconic. let's go π¦
β¨ NAME β¨
iwidgets::labeledwidget β create and manipulate a labeled widget. yeah. that's the whole job. she labels. she widgets. π
β¨ SYNOPSIS β¨
iwidgets::labeledwidget pathName ?options?
β¨ INHERITANCE β¨
follow the family tree, bestie:
itk::Widget <- iwidgets::Labeledwidget
so itk::Widget is the parent, and iwidgets::Labeledwidget is the iconic offspring. πΈ
β¨ STANDARD OPTIONS β¨
these three come free with the widget, no notes:
backgroundcursorforeground
head over to the "options" manual entry if you want the full tea on what the standard options do. β
β¨ WIDGET-SPECIFIC OPTIONS β¨
this is the main character section fr fr. every one of these gets a Name, a Class, and a Command-Line Switch:
- Name:
disabledForegroundΒ· Class:DisabledForegroundΒ· Command-Line Switch:-disabledforegroundβ sets the foreground color that shows up when the state is disabled. glow-down mode. π₯ - Name:
labelBitmapΒ· Class:BitmapΒ· Command-Line Switch:-labelbitmapβ the bitmap to display in the widget, in any of the forms thatTk_GetBitmapaccepts. heads up: this one overrides thelabeltextoption. bitmap wins, no debate. π₯ - Name:
labelFontΒ· Class:FontΒ· Command-Line Switch:-labelfontβ the font used for the label. dress her up. π - Name:
labelImageΒ· Class:ImageΒ· Command-Line Switch:-labelimageβ an image to use as the label. can be any of the values made by theimage createcommand. and listen: this option overrides both thelabelbitmapandlabeletextoptions. (yes, that's spelledlabeletextin the original, we don't fix, we preserve. π) - Name:
labelMarginΒ· Class:MarginΒ· Command-Line Switch:-labelmarginβ the distance between the childsite and the label, in any of the formsTk_GetPixelsaccepts. default is 2 pixel. personal space matters. β¨ - Name:
labelPosΒ· Class:PositionΒ· Command-Line Switch:-labelposβ where the label sits along the side of the childsite:nw,n,ne,sw,s,se,en,e,es,wn,w, orws. default isw. pick your placement, queen. π - Name:
labelTextΒ· Class:TextΒ· Command-Line Switch:-labeltextβ the text of the label around the childsite. - Name:
labelVariableΒ· Class:VariableΒ· Command-Line Switch:-labelvariableβ the text variable of the label around the childsite. live-updating label, slay. π - Name:
stateΒ· Class:StateΒ· Command-Line Switch:-stateβ one of two states for the label:normalordisabled. if the label is disabled it's displayed in a disabled foreground color. default isnormal. - Name:
stickyΒ· Class:StickyΒ· Command-Line Switch:-stickyβ the "sticky-ness" of the childsite. default value isnsew, which is the the same behavior of the labeledwidget before this option was added. (the the. we keep the the. π)
β¨ DESCRIPTION β¨
the iwidgets::labeledwidget command creates a labeled widget that contains a label and a child site. the child site is a frame, and you can fill it with literally any widget β either through a derived class, or by using the childsite method. this class was designed to be a general purpose base class for supporting the combo of a label widget and a childsite. the options include the ability to position the label around the childsite widget, modify the font and margin, and control the display of the labels. versatile icon. π
β¨ METHODS β¨
the iwidgets::labeledwidget command creates a new Tcl command whose name is pathName. you use this command to invoke various operations on the widget. general form, bestie:
pathName option ?arg arg ...?
option and the args decide exactly what the command does. here are the commands available for labeledwidget widgets: π«Ά
β¨ WIDGET-SPECIFIC METHODS β¨
pathName childsiteβ return the path name of the child site. that's it. that's the method. β¨pathName cget optionβ returns the current value of the configuration option given by option. option may have any of the values accepted by theiwidgets::labeledwidgetcommand.pathName configure ?option? ?value option value ...?β query or modify the configuration options of the widget. if no option is specified, it returns a list describing all of the available options forpathName(seeTk_ConfigureInfofor info on the format of this list). if option is specified with no value, the command returns a list describing that one named option (this list will be identical to the corresponding sublist of the value returned when no option is specified). if one or more option-value pairs are specified, the command modifies the given widget option(s) to have the given value(s) β and in that case the command returns an empty string. option may have any of the values accepted by theiwidgets::labeledwidgetcommand.
β¨ STATIC METHODS β¨
iwidgets::Labeledwidget::alignlabels widget ?widget ...?β thealignlabelsprocedure takes a list of widgets derived from theLabeledwidgetclass and uses the label margin to make each widget have the same total space for the combination of label and margin. the net effect is that the labels get left aligned. ngl, this method is generally only useful with a label position ofw, which is the default. π
β¨ COMPONENTS β¨
- Name:
labelΒ· Class:labelβ the label component provides the label for the labeled widget. see the "label" widget manual entry for the details on the label component item. πΈ - Name:
lwchildsiteΒ· Class:frameβ the lwchildsite component is the user child site for the labeled widget. see the "frame" widget manual entry for the details on the lwchildsite component item. π¦
β¨ EXAMPLE β¨
the labeledwidget was primarily meant to be a base class. ScrolledListBox and EntryField are good examples of derived classes of the labeledwidget class. in order to provide equal support for composite classes, the childsite method also exists. here's an example of childsite method usage, verbatim, no cap:
package require Iwidgets 4.0
iwidgets::labeledwidget .lw -labeltext "Canvas Widget" -labelpos s
pack .lw -fill both -expand yes -padx 10 -pady 10
set cw [canvas [.lw childsite].c -relief raised -width 200 -height 200]
pack $cw -padx 10 -pady 10
β¨ AUTHOR β¨
Mark L. Ulferts β thank you for your service, king. π«‘
β¨ KEYWORDS β¨
labeledwidget, widget
okay that's the whole page, bestie, you ate that. this one comes to you straight from the Tk manual, page iwidgets::labeledwidget(1), section 1 β that's the source and the version right there in the footer, no extra date tea, so don't come for me. go build something cute with it. mwah. ππ
π¦ 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