ActiveTcl User Guide

Table of Contents

iwidgets::labeledwidget pathName ?options? itk::Widget <- iwid- gets::Labeledwidget
background cursor foreground

See the options manual entry for details on the standard op-

tions.

Name: disabledForeground

Class: DisabledForeground

Command-Line Switch: -disabledforeground

Specifies the foreground to be used when the state is disabled.

Name: labelBitmap

Class: Bitmap

Command-Line Switch: -labelbitmap

Specifies a bitmap to display in the widget, in any of the forms

acceptable to Tk_GetBitmap. This option overrides the labeltext option.

Name: labelFont

Class: Font

Command-Line Switch: -labelfont

Specifies the font to be used for the label.

Name: labelImage

Class: Image

Command-Line Switch: -labelimage

Specifies a image to be used as the label. The image may be any

of the values created by the image create command. This option overrides both the labelbitmap and labeletext options.

Name: labelMargin

Class: Margin

Command-Line Switch: -labelmargin

Specifies the distance between the childsite and label in any of

the forms acceptable to Tk_GetPixels. The default is 2 pixel.

Name: labelPos

Class: Position

Command-Line Switch: -labelpos

Specifies the position of the label along the side of the child-

site: nw, n, ne, sw, s, se, en, e, es, wn, w, or ws. The default is w.

Name: labelText

Class: Text

Command-Line Switch: -labeltext

Specifies the text of the label around the childsite.

Name: labelVariable

Class: Variable

Command-Line Switch: -labelvariable

Specifies the text variable of the label around the childsite.

Name: state

Class: State

Command-Line Switch: -state

Specifies one of two states for the label: normal or disabled.

If the label is disabled then it is displayed in a disabled fore-

ground color. The default is normal.

Name: sticky

Class: Sticky

Command-Line Switch: -sticky

Specifies the sticky-ness of the childsite. The default value

is nsew, which is the the same behavior of the labeledwidget be- fore this option was added.
_________________________________________________________________ which can filled with any widget via a derived class or though the use of the childsite method. This class was designed to be a general purpose base class for supporting the combination of la- bel 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. whose name is pathName. This command may be used to invoke vari- ous 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.

pathName childsite Return the path name of the child site. path-

Name cget option Returns the current value of the configuration

option given by option. Option may have any of the values ac- cepted by the iwidgets::labeledwidget command. pathName config*- ure ?option? ?value option value ...? Query or modify the con- figuration options of the widget. If no option is specified, re- turns 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::labeledwidget command. alignlabels procedure takes a list of widgets derived from the

Labeledwidget class and uses the label margin to make each widget

have the same total space for the combination of label and mar- gin. The net effect is to left align the labels. Generally, this method is only useful with a label position of w, which is the default.

Name: label

Class: label

See the label widget manual entry for details on the label com-

ponent item.

Name: lwchildsite

Class: frame

widget. See the frame widget manual entry for details on the lwchildsite component item.

ScrolledListBox and EntryField are good examples of derived

classes of the labeledwidget class. In order to provide equal support for composite classes, the `childsite' methods also ex- ists. The following is an example of `childsite' method usage.

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

Mark L. Ulferts labeledwidget, widget


Table of Contents