Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
2 | .\" | |
3 | .\" Standard preamble: | |
4 | .\" ======================================================================== | |
5 | .de Sh \" Subsection heading | |
6 | .br | |
7 | .if t .Sp | |
8 | .ne 5 | |
9 | .PP | |
10 | \fB\\$1\fR | |
11 | .PP | |
12 | .. | |
13 | .de Sp \" Vertical space (when we can't use .PP) | |
14 | .if t .sp .5v | |
15 | .if n .sp | |
16 | .. | |
17 | .de Vb \" Begin verbatim text | |
18 | .ft CW | |
19 | .nf | |
20 | .ne \\$1 | |
21 | .. | |
22 | .de Ve \" End verbatim text | |
23 | .ft R | |
24 | .fi | |
25 | .. | |
26 | .\" Set up some character translations and predefined strings. \*(-- will | |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a | |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to | |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' | |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. | |
32 | .tr \(*W-|\(bv\*(Tr | |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
34 | .ie n \{\ | |
35 | . ds -- \(*W- | |
36 | . ds PI pi | |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
39 | . ds L" "" | |
40 | . ds R" "" | |
41 | . ds C` "" | |
42 | . ds C' "" | |
43 | 'br\} | |
44 | .el\{\ | |
45 | . ds -- \|\(em\| | |
46 | . ds PI \(*p | |
47 | . ds L" `` | |
48 | . ds R" '' | |
49 | 'br\} | |
50 | .\" | |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for | |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the | |
54 | .\" output yourself in some meaningful fashion. | |
55 | .if \nF \{\ | |
56 | . de IX | |
57 | . tm Index:\\$1\t\\n%\t"\\$2" | |
58 | .. | |
59 | . nr % 0 | |
60 | . rr F | |
61 | .\} | |
62 | .\" | |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
64 | .\" way too many mistakes in technical documents. | |
65 | .hy 0 | |
66 | .if n .na | |
67 | .\" | |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. | |
70 | . \" fudge factors for nroff and troff | |
71 | .if n \{\ | |
72 | . ds #H 0 | |
73 | . ds #V .8m | |
74 | . ds #F .3m | |
75 | . ds #[ \f1 | |
76 | . ds #] \fP | |
77 | .\} | |
78 | .if t \{\ | |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
80 | . ds #V .6m | |
81 | . ds #F 0 | |
82 | . ds #[ \& | |
83 | . ds #] \& | |
84 | .\} | |
85 | . \" simple accents for nroff and troff | |
86 | .if n \{\ | |
87 | . ds ' \& | |
88 | . ds ` \& | |
89 | . ds ^ \& | |
90 | . ds , \& | |
91 | . ds ~ ~ | |
92 | . ds / | |
93 | .\} | |
94 | .if t \{\ | |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
101 | .\} | |
102 | . \" troff and (daisy-wheel) nroff accents | |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
110 | .ds ae a\h'-(\w'a'u*4/10)'e | |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E | |
112 | . \" corrections for vroff | |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
115 | . \" for low resolution devices (crt and lpr) | |
116 | .if \n(.H>23 .if \n(.V>19 \ | |
117 | \{\ | |
118 | . ds : e | |
119 | . ds 8 ss | |
120 | . ds o a | |
121 | . ds d- d\h'-1'\(ga | |
122 | . ds D- D\h'-1'\(hy | |
123 | . ds th \o'bp' | |
124 | . ds Th \o'LP' | |
125 | . ds ae ae | |
126 | . ds Ae AE | |
127 | .\} | |
128 | .rm #[ #] #H #V #F C | |
129 | .\" ======================================================================== | |
130 | .\" | |
131 | .IX Title "CHECKBUTTON 1" | |
132 | .TH CHECKBUTTON 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation" | |
133 | .SH "NAME" | |
134 | Tk::Checkbutton \- Create and manipulate Checkbutton widgets | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | \&\fI$checkbutton\fR = \fI$parent\fR\->\fBCheckbutton\fR(?\fIoptions\fR?); | |
138 | .SH "STANDARD OPTIONS" | |
139 | .IX Header "STANDARD OPTIONS" | |
140 | \&\fB\-activebackground\fR \fB\-cursor\fR \fB\-highlightthickness\fR \fB\-takefocus\fR | |
141 | \&\fB\-activeforeground\fR \fB\-disabledforeground\fR \fB\-image\fR \fB\-text\fR | |
142 | \&\fB\-anchor\fR \fB\-font\fR \fB\-justify\fR \fB\-textvariable\fR | |
143 | \&\fB\-background\fR \fB\-foreground\fR \fB\-padx\fR \fB\-underline\fR | |
144 | \&\fB\-bitmap\fR \fB\-highlightbackground\fR \fB\-pady\fR \fB\-wraplength\fR | |
145 | \&\fB\-borderwidth\fR \fB\-highlightcolor\fR \fB\-relief\fR | |
146 | .PP | |
147 | See Tk::options for details of the standard options. | |
148 | .SH "WIDGET-SPECIFIC OPTIONS" | |
149 | .IX Header "WIDGET-SPECIFIC OPTIONS" | |
150 | .IP "Name: \fBcommand\fR" 4 | |
151 | .IX Item "Name: command" | |
152 | .PD 0 | |
153 | .IP "Class: \fBCommand\fR" 4 | |
154 | .IX Item "Class: Command" | |
155 | .IP "Switch: \fB\-command\fR" 4 | |
156 | .IX Item "Switch: -command" | |
157 | .PD | |
158 | Specifies a perl/Tk callback to associate with the button. This command | |
159 | is typically invoked when mouse button 1 is released over the button | |
160 | window. The button's global variable (\fB\-variable\fR option) will | |
161 | be updated before the command is invoked. | |
162 | .IP "Name: \fBheight\fR" 4 | |
163 | .IX Item "Name: height" | |
164 | .PD 0 | |
165 | .IP "Class: \fBHeight\fR" 4 | |
166 | .IX Item "Class: Height" | |
167 | .IP "Switch: \fB\-height\fR" 4 | |
168 | .IX Item "Switch: -height" | |
169 | .PD | |
170 | Specifies a desired height for the button. | |
171 | If an image or bitmap is being displayed in the button then the value is in | |
172 | screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR); | |
173 | for text it is in lines of text. | |
174 | If this option isn't specified, the button's desired height is computed | |
175 | from the size of the image or bitmap or text being displayed in it. | |
176 | .IP "Name: \fBindicatorOn\fR" 4 | |
177 | .IX Item "Name: indicatorOn" | |
178 | .PD 0 | |
179 | .IP "Class: \fBIndicatorOn\fR" 4 | |
180 | .IX Item "Class: IndicatorOn" | |
181 | .IP "Switch: \fB\-indicatoron\fR" 4 | |
182 | .IX Item "Switch: -indicatoron" | |
183 | .PD | |
184 | Specifies whether or not the indicator should be drawn. Must be a | |
185 | proper boolean value. If false, the \fBrelief\fR option is | |
186 | ignored and the widget's relief is always sunken if the widget is | |
187 | selected and raised otherwise. | |
188 | .IP "Name: \fBoffValue\fR" 4 | |
189 | .IX Item "Name: offValue" | |
190 | .PD 0 | |
191 | .IP "Class: \fBValue\fR" 4 | |
192 | .IX Item "Class: Value" | |
193 | .IP "Switch: \fB\-offvalue\fR" 4 | |
194 | .IX Item "Switch: -offvalue" | |
195 | .PD | |
196 | Specifies value to store in the button's associated variable whenever | |
197 | this button is deselected. Defaults to ``0''. | |
198 | .IP "Name: \fBonValue\fR" 4 | |
199 | .IX Item "Name: onValue" | |
200 | .PD 0 | |
201 | .IP "Class: \fBValue\fR" 4 | |
202 | .IX Item "Class: Value" | |
203 | .IP "Switch: \fB\-onvalue\fR" 4 | |
204 | .IX Item "Switch: -onvalue" | |
205 | .PD | |
206 | Specifies value to store in the button's associated variable whenever | |
207 | this button is selected. Defaults to ``1''. | |
208 | .IP "Name: \fBselectColor\fR" 4 | |
209 | .IX Item "Name: selectColor" | |
210 | .PD 0 | |
211 | .IP "Class: \fBBackground\fR" 4 | |
212 | .IX Item "Class: Background" | |
213 | .IP "Switch: \fB\-selectcolor\fR" 4 | |
214 | .IX Item "Switch: -selectcolor" | |
215 | .PD | |
216 | Specifies a background color to use when the button is selected. | |
217 | If \fBindicatorOn\fR is true then the color applies to the indicator. | |
218 | Under Windows, this color is used as the background for the indicator | |
219 | regardless of the select state. | |
220 | If \fBindicatorOn\fR is false, this color is used as the background | |
221 | for the entire widget, in place of \fBbackground\fR or \fBactiveBackground\fR, | |
222 | whenever the widget is selected. | |
223 | If specified as an empty string then no special color is used for | |
224 | displaying when the widget is selected. | |
225 | .IP "Name: \fBselectImage\fR" 4 | |
226 | .IX Item "Name: selectImage" | |
227 | .PD 0 | |
228 | .IP "Class: \fBSelectImage\fR" 4 | |
229 | .IX Item "Class: SelectImage" | |
230 | .IP "Switch: \fB\-selectimage\fR" 4 | |
231 | .IX Item "Switch: -selectimage" | |
232 | .PD | |
233 | Specifies an image to display (in place of the \fBimage\fR option) | |
234 | when the checkbutton is selected. | |
235 | This option is ignored unless the \fBimage\fR option has been | |
236 | specified. | |
237 | .IP "Name: \fBstate\fR" 4 | |
238 | .IX Item "Name: state" | |
239 | .PD 0 | |
240 | .IP "Class: \fBState\fR" 4 | |
241 | .IX Item "Class: State" | |
242 | .IP "Switch: \fB\-state\fR" 4 | |
243 | .IX Item "Switch: -state" | |
244 | .PD | |
245 | Specifies one of three states for the checkbutton: \fBnormal\fR, \fBactive\fR, | |
246 | or \fBdisabled\fR. In normal state the checkbutton is displayed using the | |
247 | \&\fBforeground\fR and \fBbackground\fR options. The active state is | |
248 | typically used when the pointer is over the checkbutton. In active state | |
249 | the checkbutton is displayed using the \fBactiveForeground\fR and | |
250 | \&\fBactiveBackground\fR options. Disabled state means that the checkbutton | |
251 | should be insensitive: the default bindings will refuse to activate | |
252 | the widget and will ignore mouse button presses. | |
253 | In this state the \fBdisabledForeground\fR and | |
254 | \&\fBbackground\fR options determine how the checkbutton is displayed. | |
255 | .IP "Name: \fBvariable\fR" 4 | |
256 | .IX Item "Name: variable" | |
257 | .PD 0 | |
258 | .IP "Class: \fBVariable\fR" 4 | |
259 | .IX Item "Class: Variable" | |
260 | .IP "Switch: \fB\-variable\fR" 4 | |
261 | .IX Item "Switch: -variable" | |
262 | .PD | |
263 | Specifies reference to a variable to set to indicate whether | |
264 | or not this button is selected. Defaults to \f(CW\*(C`\e$widget\->{'Value'}\*(C'\fR | |
265 | member of the widget's hash. In general perl variables are \f(CW\*(C`undef\*(C'\fR unless | |
266 | specifically initialized which will not match either default \fB\-onvalue\fR or | |
267 | default \fB\-offvalue\fR. | |
268 | .IP "Name: \fBwidth\fR" 4 | |
269 | .IX Item "Name: width" | |
270 | .PD 0 | |
271 | .IP "Class: \fBWidth\fR" 4 | |
272 | .IX Item "Class: Width" | |
273 | .IP "Switch: \fB\-width\fR" 4 | |
274 | .IX Item "Switch: -width" | |
275 | .PD | |
276 | Specifies a desired width for the button. | |
277 | If an image or bitmap is being displayed in the button then the value is in | |
278 | screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR); | |
279 | for text it is in characters. | |
280 | If this option isn't specified, the button's desired width is computed | |
281 | from the size of the image or bitmap or text being displayed in it. | |
282 | .SH "DESCRIPTION" | |
283 | .IX Header "DESCRIPTION" | |
284 | The \fBCheckbutton\fR method creates a new window (given by the | |
285 | \&\f(CW$widget\fR argument) and makes it into a checkbutton widget. | |
286 | Additional | |
287 | options, described above, may be specified on the command line | |
288 | or in the option database | |
289 | to configure aspects of the checkbutton such as its colors, font, | |
290 | text, and initial relief. The \fBcheckbutton\fR command returns its | |
291 | \&\f(CW$widget\fR argument. At the time this command is invoked, | |
292 | there must not exist a window named \f(CW$widget\fR, but | |
293 | \&\f(CW$widget\fR's parent must exist. | |
294 | .PP | |
295 | A checkbutton is a widget | |
296 | that displays a textual string, bitmap or image | |
297 | and a square called an \fIindicator\fR. | |
298 | If text is displayed, it must all be in a single font, but it | |
299 | can occupy multiple lines on the screen (if it contains newlines | |
300 | or if wrapping occurs because of the \fBwrapLength\fR option) and | |
301 | one of the characters may optionally be underlined using the | |
302 | \&\fBunderline\fR option. | |
303 | A checkbutton has | |
304 | all of the behavior of a simple button, including the | |
305 | following: it can display itself in either of three different | |
306 | ways, according to the \fBstate\fR option; | |
307 | it can be made to appear | |
308 | raised, sunken, or flat; it can be made to flash; and it invokes | |
309 | a perl/Tk callback whenever mouse button 1 is clicked over the | |
310 | checkbutton. | |
311 | .PP | |
312 | In addition, checkbuttons can be \fIselected\fR. | |
313 | If a checkbutton is selected then the indicator is normally | |
314 | drawn with a selected appearance, and | |
315 | a Tcl variable associated with the checkbutton is set to a particular | |
316 | value (normally 1). | |
317 | Under Unix, the indicator is drawn with a sunken relief and a special | |
318 | color. Under Windows, the indicator is drawn with a check mark inside. | |
319 | If the checkbutton is not selected, then the indicator is drawn with a | |
320 | deselected appearance, and the associated variable is | |
321 | set to a different value (typically 0). | |
322 | Under Unix, the indicator is drawn with a raised relief and no special | |
323 | color. Under Windows, the indicator is drawn without a check mark inside. | |
324 | By default, the name of the variable associated with a checkbutton is the | |
325 | same as the \fIname\fR used to create the checkbutton. | |
326 | The variable name, and the ``on'' and ``off'' values stored in it, | |
327 | may be modified with options on the command line or in the option | |
328 | database. | |
329 | Configuration options may also be used to modify the way the | |
330 | indicator is displayed (or whether it is displayed at all). | |
331 | By default a checkbutton is configured to select and deselect | |
332 | itself on alternate button clicks. | |
333 | In addition, each checkbutton monitors its associated variable and | |
334 | automatically selects and deselects itself when the variables value | |
335 | changes to and from the button's ``on'' value. | |
336 | .SH "WIDGET METHODS" | |
337 | .IX Header "WIDGET METHODS" | |
338 | The \fBCheckbutton\fR method creates a widget object. | |
339 | This object supports the \fBconfigure\fR and \fBcget\fR methods | |
340 | described in Tk::options which can be used to enquire and | |
341 | modify the options described above. | |
342 | The widget also inherits all the methods provided by the generic | |
343 | Tk::Widget class. | |
344 | .PP | |
345 | The following additional methods are available for checkbutton widgets: | |
346 | .IP "\fI$checkbutton\fR\->\fBdeselect\fR" 4 | |
347 | .IX Item "$checkbutton->deselect" | |
348 | Deselects the checkbutton and sets the associated variable to its ``off'' | |
349 | value. | |
350 | .IP "\fI$checkbutton\fR\->\fBflash\fR" 4 | |
351 | .IX Item "$checkbutton->flash" | |
352 | Flashes the checkbutton. This is accomplished by redisplaying the checkbutton | |
353 | several times, alternating between active and normal colors. At | |
354 | the end of the flash the checkbutton is left in the same normal/active | |
355 | state as when the command was invoked. | |
356 | This command is ignored if the checkbutton's state is \fBdisabled\fR. | |
357 | .IP "\fI$checkbutton\fR\->\fBinvoke\fR" 4 | |
358 | .IX Item "$checkbutton->invoke" | |
359 | Does just what would have happened if the user invoked the checkbutton | |
360 | with the mouse: toggle the selection state of the button and invoke | |
361 | the perl/Tk callback associated with the checkbutton, if there is one. | |
362 | The return value is the return value from the perl/Tk callback, or an | |
363 | empty string if there is no command associated with the checkbutton. | |
364 | This command is ignored if the checkbutton's state is \fBdisabled\fR. | |
365 | .IP "\fI$checkbutton\fR\->\fBselect\fR" 4 | |
366 | .IX Item "$checkbutton->select" | |
367 | Selects the checkbutton and sets the associated variable to its ``on'' | |
368 | value. | |
369 | .IP "\fI$checkbutton\fR\->\fBtoggle\fR" 4 | |
370 | .IX Item "$checkbutton->toggle" | |
371 | Toggles the selection state of the button, redisplaying it and | |
372 | modifying its associated variable to reflect the new state. | |
373 | .SH "BINDINGS" | |
374 | .IX Header "BINDINGS" | |
375 | Tk automatically creates class bindings for checkbuttons that give them | |
376 | the following default behavior: | |
377 | .IP "[1]" 4 | |
378 | .IX Item "[1]" | |
379 | On Unix systems, a checkbutton activates whenever the mouse passes | |
380 | over it and deactivates whenever the mouse leaves the checkbutton. On | |
381 | Mac and Windows systems, when mouse button 1 is pressed over a | |
382 | checkbutton, the button activates whenever the mouse pointer is inside | |
383 | the button, and deactivates whenever the mouse pointer leaves the | |
384 | button. | |
385 | .IP "[2]" 4 | |
386 | .IX Item "[2]" | |
387 | When mouse button 1 is pressed over a checkbutton, it is invoked (its | |
388 | selection state toggles and the command associated with the button is | |
389 | invoked, if there is one). | |
390 | .IP "[3]" 4 | |
391 | .IX Item "[3]" | |
392 | When a checkbutton has the input focus, the space key causes the checkbutton | |
393 | to be invoked. Under Windows, there are additional key bindings; plus | |
394 | (+) and equal (=) select the button, and minus (\-) deselects the button. | |
395 | .Sp | |
396 | If the checkbutton's state is \fBdisabled\fR then none of the above | |
397 | actions occur: the checkbutton is completely non\-responsive. | |
398 | .Sp | |
399 | The behavior of checkbuttons can be changed by defining new bindings for | |
400 | individual widgets or by redefining the class bindings. | |
401 | .SH "KEYWORDS" | |
402 | .IX Header "KEYWORDS" | |
403 | checkbutton, widget |