1iwidgets::labeledwidget  − Create and manipulate a labeled widget

iwidgets::labeledwidget pathName ?options? itk::Widget <‐ iwid‐

3gets::Labeledwidget

background cursor foreground

5See  the  "options"  manual entry for details on the standard op‐
6tions.
7Name:           disabledForeground
8Class:          DisabledForeground
9Command‐Line Switch:           ‐disabledforeground
10Specifies the foreground to be used when the state is disabled.
11Name:           labelBitmap
12Class:          Bitmap
13Command‐Line Switch:           ‐labelbitmap
14Specifies a bitmap to display in the widget, in any of the  forms
15acceptable  to Tk_GetBitmap.  This option overrides the labeltext
16option.
17Name:           labelFont
18Class:          Font
19Command‐Line Switch:           ‐labelfont
20Specifies the font to be used for the label.
21Name:           labelImage
22Class:          Image
23Command‐Line Switch:           ‐labelimage
24Specifies a image to be used as the label. The image may  be  any
25of  the  values created by the image create command.  This option
26overrides both the labelbitmap and labeletext options.
27Name:           labelMargin
28Class:          Margin
29Command‐Line Switch:           ‐labelmargin
30Specifies the distance between the childsite and label in any  of
31the forms acceptable to Tk_GetPixels.  The default is 2 pixel.
32Name:           labelPos
33Class:          Position
34Command‐Line Switch:           ‐labelpos
35Specifies  the position of the label along the side of the child‐
36site: nw, n, ne, sw, s, se, en, e, es, wn, w, or ws.  The default
37is w.
38Name:           labelText
39Class:          Text
40Command‐Line Switch:           ‐labeltext
41Specifies the text of the label around the childsite.
42Name:           labelVariable
43Class:          Variable
44Command‐Line Switch:           ‐labelvariable
45Specifies the text variable of the label around the childsite.
46Name:           state
47Class:          State
48Command‐Line Switch:           ‐state
49Specifies  one  of  two states for the label: normal or disabled.
50If the label is disabled then it is displayed in a disabled fore‐
51ground color.  The default is normal.
52Name:           sticky
53Class:          Sticky
54Command‐Line Switch:           ‐sticky
55Specifies  the "sticky‐ness" of the childsite.  The default value
56is nsew, which is the the same behavior of the labeledwidget  be‐
57fore this option was added.
58
59The  iwidgets::labeledwidget  command  creates  a  labeled widget
60which contains a label and child site.  The child site is a frame
61which  can  filled  with any widget via a derived class or though
62the use of the childsite method.  This class was designed to be a
63general  purpose base class for supporting the combination of la‐
64bel widget and a childsite.  The options include the  ability  to
65position  the  label around the childsite widget, modify the font
66and margin, and control the display of the labels.
67
68The iwidgets::labeledwidget command creates  a  new  Tcl  command
69whose name is pathName.  This command may be used to invoke vari‐
70ous operations on the widget.  It has the following general form:

pathName option ?arg arg ...? Option and the args determine the

72exact behavior of the command.  The following commands are possi‐
73ble for labeledwidget widgets: pathName childsite Return the path
74name of the child site.  pathName cget option Returns the current
75value  of  the  configuration option given by option.  Option may
76have any of the values accepted  by  the  iwidgets::labeledwidget
77command.   pathName  configure  ?option? ?value option value ...?
78Query or modify the configuration options of the widget.   If  no

option is specified, returns a list describing all of the avail‐

80able options for pathName (see Tk_ConfigureInfo  for  information
81on the format of this list).  If option is specified with no val‐

ue, then the command returns a list describing the one named op‐

83tion (this list will be identical to the corresponding sublist of
84the value returned if no option is specified).  If  one  or  more

option−value pairs are specified, then the command modifies the

86given widget option(s) to have the given value(s);  in this  case
87the  command returns an empty string.  Option may have any of the
88values accepted by the iwidgets::labeledwidget command.
89

iwidgets::Labeledwidget::alignlabels widget ?widget ...? The

91alignlabels  procedure  takes  a list of widgets derived from the
92Labeledwidget class and uses the label margin to make each widget
93have  the  same total space for the combination of label and mar‐
94gin.  The net effect is to left  align  the  labels.   Generally,
95this  method  is only useful with a label position of w, which is
96the default.
97
98Name:           label
99Class:          label
100The label component provides the label for  the  labeled  widget.
101See the "label" widget manual entry for details on the label com‐
102ponent item.
103Name:           lwchildsite
104Class:          frame
105The lwchildsite component is the user child site for the  labeled
106widget.   See  the "frame" widget manual entry for details on the
107lwchildsite component item.
108
109The labeledwidget was primarily meant to be a  base  class.   The
110ScrolledListBox  and  EntryField  are  good  examples  of derived
111classes of the labeledwidget class.  In order  to  provide  equal
112support  for  composite classes, the ’childsite’ methods also ex‐
113ists.  The following is an example of ’childsite’ method usage.
114 package require Iwidgets 4.0
115 iwidgets::labeledwidget .lw ‐labeltext "Canvas Widget" ‐labelpos
116s
117 pack .lw ‐fill both ‐expand yes ‐padx 10 ‐pady 10
118
119 set  cw  [canvas  [.lw  childsite].c  ‐relief  raised ‐width 200
120‐height 200]
121 pack $cw ‐padx 10 ‐pady 10 Mark L. Ulferts labeledwidget, widget
122
123
124
125
126
127
128
129
130
131
132
Impressum