1iwidgets::checkbox  −  Create  and  manipulate  a checkbox widget

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

3gets::Labeledframe <‐ iwidgets::Checkbox

background borderWidth cursor disabledForeground

foreground relief selectColor

6See  the  "options"  manual entry for details on the standard op‐
7tions.

labelBitmap labelFont labelImage labelMargin

labelPos labelText labelVariable

10See the "labeledframe" class manual entry for details on the  in‐
11herited options.
12Name:   command
13Class:  Command
14Command‐Line Switch:    ‐command
15Specifies  a  Tcl  command  procedure to be evaluated following a
16change in the current check box selection.
17Name:   orient
18Class:  Orient
19Command‐Line Switch:    ‐orient
20Default Value:  vertical
21Specifies the orientation of the checkbuttons within  the  check‐
22box.  Valid values are either "horizontal" or "vertical".
23
24The  iwidgets::checkbox command creates a check button box widget
25capable of adding, inserting, deleting, selecting, and  configur‐
26ing checkbuttons as well as obtaining the currently selected but‐
27ton.
28
29The iwidgets::checkbox command creates a new  Tcl  command  whose
30name is pathName.  This command may be used to invoke various op‐
31erations on the widget.  It has the following general form: path‐

Name option ?arg arg ...? Option and the args determine the ex‐

33act behavior of the command.  Many of the widget commands for the

checkbox take as one argument an indicator of which checkbutton

35of the checkbox to operate on.  These indicators are  called  in‐

dexes and allow reference and manipulation of checkbuttons.

37Checkbox indexes may be specified in any of the following  forms:

number Specifies the checkbutton numerically, where 0 corresponds

39to the top checkbutton of the checkbox.  end Indicates  the  last
40checkbutton of the checkbox.  pattern If the index doesn’t satis‐
41fy one of the above forms then this form  is  used.   Pattern  is
42pattern‐matched against the tag of each checkbutton in the check‐
43box, in order from top to  bottom,  until  a  matching  entry  is
44found.  The rules of Tcl_StringMatch are used.
45

pathName add tag ?option value option value? Adds a new check‐

47button to the checkbuttond window on  the  bottom.   The  command
48takes  additional  options which are passed on to the checkbutton
49as construction arguments.  These include the standard Tk  check‐
50button  options.   The tag is returned.  pathName buttonconfigure

index ?options? This command is similar to the configure com‐

52mand,  except  that  it  applies to the options for an individual
53checkbutton, whereas configureapplies  to  the  options  for  the
54checkbox as a whole.  Options may have any of the values accepted
55by the add widget command.  If options are specified, options are
56modified  as  indicated in the command and the command returns an
57empty string.  If no options are specified, returns  a  list  de‐
58scribing the current options for entry index (see Tk_ConfigureIn‐

fo for information on the format of this list). pathName cget

option Returns the current value of the configuration option giv‐

61en 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

64the widget.  If no option is specified, returns a list describing
65all of the available options for pathName  (see  Tk_ConfigureInfo
66for information on the format of this list).  If option is speci‐
67fied with no value, then the command returns  a  list  describing
68the  one  named option (this list will be identical to the corre‐
69sponding sublist of the value returned if  no  option  is  speci‐
70fied).  If one or more option−value pairs are specified, then the
71command modifies the given widget option(s)  to  have  the  given
72value(s);  in this case the command returns an empty string.  Op‐

tion may have any of the values accepted by the iwidgets::check‐

box command. pathName delete index Deletes a specified checkbut‐

75ton given an index.  pathName deselect index Deselects  a  speci‐
76fied  checkbutton given an index.  pathName flash index Flashes a
77specified checkbutton given an index.  pathName get ?index?   Re‐
78turns  the tags of the currently selected checkbuttons or the se‐
79lection status of  specific  checkbutton  when  given  an  index.

pathName index index Returns the numerical index corresponding to

81index.  pathName insert index tag ?option value option value ...?
82Same  as the add command except that it inserts the new checkbut‐
83ton just before the one given by index, instead of  appending  to
84the  end  of  the checkbox.  The option, and value arguments have
85the same interpretation as for the add widget command.   pathName

select index Selects a specified checkbutton given an index.

87
88 package require Iwidgets 4.0
89 iwidgets::checkbox .cb ‐labeltext Styles
90 .cb add bold ‐text Bold
91 .cb add italic ‐text Italic
92 .cb add underline ‐text Underline
93 .cb select underline
94
95 pack .cb ‐padx 10 ‐pady 10 ‐fill both ‐expand yes
96
97John A. Tucker checkbox, widget
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum