summaryrefslogtreecommitdiff
path: root/iwidgets/doc/checkbox.n
blob: eaa60062d6cf2a34a8232b9cefff41d6e468e04d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
'\"
'\" Copyright (c) 1995 DSC Technologies Corporation
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" @(#) checkbox.n 1.21 94/12/17 16:04:44
'\" 
.so man.macros
.HS iwidgets::checkbox iwid
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
iwidgets::checkbox \- Create and manipulate a checkbox widget
.SH SYNOPSIS
\fBiwidgets::checkbox\fI \fIpathName \fR?\fIoptions\fR?
.SH "INHERITANCE"
itk::Widget <- iwidgets::Labeledframe <- iwidgets::Checkbox
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 4c 8c 12c
\fBbackground\fR	\fBborderWidth\fR	\fBcursor\fR	\fBdisabledForeground\fR
\fBforeground\fR	\fBrelief\fR	\fBselectColor\fR
.fi
.LP
See the "options" manual entry for details on the standard options.
.SH "INHERITED OPTIONS"
.LP
.nf
.ta 4c 8c 12c
\fBlabelBitmap\fR	\fBlabelFont\fR	\fBlabelImage\fR	\fBlabelMargin\fR
\fBlabelPos\fR	\fBlabelText\fR	\fBlabelVariable\fR
.fi
.LP
See the "labeledframe" class manual entry for details on the 
inherited options.
.SH "WIDGET-SPECIFIC OPTIONS"
.LP
.nf
Name:   \fBcommand\fR
Class:  \fBCommand\fR
Command-Line Switch:    \fB-command\fR
.fi
.IP
Specifies a Tcl command procedure to be evaluated following a  change in 
the current check box selection.
.LP
.nf
Name:   \fBorient\fR
Class:  \fBOrient\fR
Command-Line Switch:    \fB-orient\fR
Default Value:  \fBvertical\fR
.fi
.IP
Specifies the orientation of the checkbuttons within the checkbox.  Valid
values are either "horizontal" or "vertical".
.LP
.BE

.SH DESCRIPTION
.PP
The \fBiwidgets::checkbox\fR command creates a check button box widget 
capable of adding, inserting, deleting, selecting, and configuring 
checkbuttons as well as obtaining the currently selected button.

.SH "METHODS"
.PP
The \fBiwidgets::checkbox\fR command creates a new Tcl command whose
name is \fIpathName\fR.  This
command may be used to invoke various
operations on the widget.  It has the following general form:
.DS C
\fIpathName option \fR?\fIarg arg ...\fR?
.DE
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command.  
.PP
Many of the widget commands for the \fBcheckbox\fR take as one argument an
indicator of which checkbutton of the checkbox to operate on.  These indicators
are called \fIindexes\fR and allow reference and manipulation of checkbuttons.
Checkbox indexes may be specified in any of the following forms:
.TP 12
\fInumber\fR
Specifies the checkbutton numerically, where 0 corresponds to the top 
checkbutton of the checkbox.
.TP 12
\fBend\fR
Indicates the last checkbutton of the checkbox.
.TP 12
\fIpattern\fR
If the index doesn't satisfy one of the above forms then this
form is used.  \fIPattern\fR 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 \fBTcl_StringMatch\fR
are used.

.SH "WIDGET-SPECIFIC METHODS"
.TP
\fIpathName \fBadd\fR \fItag\fR ?\fIoption value option value\fR?
Adds a new checkbutton to the checkbuttond 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.
.TP
\fIpathName \fBbuttonconfigure\fR \fIindex\fR ?\fIoptions\fR?
This command is similar to the \fBconfigure\fR command, except that
it applies to the options for an individual checkbutton, 
whereas \fBconfigure\fRapplies to the options for the checkbox as a whole.
\fIOptions\fR may have any of the values accepted by the \fBadd\fR
widget command.  If \fIoptions\fR are specified, options are modified
as indicated in the command and the command returns an empty string.
If no \fIoptions\fR are specified, returns a list describing
the current options for entry \fIindex\fR (see \fBTk_ConfigureInfo\fR for
information on the format of this list).
.TP
\fIpathName \fBcget\fR \fIoption\fR
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBiwidgets::checkbox\fR
command.
.TP
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
information on the format of this list).  If \fIoption\fR is specified
with no \fIvalue\fR, 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 \fIoption\fR is specified).  If
one or more \fIoption\-value\fR 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.
\fIOption\fR may have any of the values accepted by the \fBiwidgets::checkbox\fR
command.
.TP
\fIpathName \fBdelete\fR \fIindex\fR
Deletes a specified checkbutton given an \fIindex\fR.
.TP
\fIpathName \fBdeselect\fR \fIindex\fR
Deselects a specified checkbutton given an \fIindex\fR.
.TP
\fIpathName \fBflash\fR \fIindex\fR
Flashes a specified checkbutton given an \fIindex\fR.
.TP
\fIpathName \fBget\fR ?\fIindex\fR?
Returns the tags of the currently selected checkbuttons or the 
selection status of specific checkbutton when given an index.
.TP
\fIpathName \fBindex\fR \fIindex\fR
Returns the numerical index corresponding to index.
.TP
\fIpathName \fBinsert \fIindex\fR \fItag\fR ?\fIoption value option value ...\fR?
Same as the \fBadd\fR command except that it inserts the new
checkbutton just before the one given by \fIindex\fR, instead of appending
to the end of the checkbox.  The \fIoption\fR, and \fIvalue\fR
arguments have the same interpretation as for the \fBadd\fR widget
command.  
.TP
\fIpathName \fBselect\fR \fIindex\fR
Selects a specified checkbutton given an \fIindex\fR.

.SH EXAMPLE
.DS
 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
.DE

.SH AUTHOR
John A. Tucker
.SH KEYWORDS
checkbox, widget