OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tk8.6.12 / tests / button.test
1 # This file is a Tcl script to test labels, buttons, checkbuttons, and
2 # radiobuttons in Tk (i.e., all the widgets defined in tkButton.c).  It is
3 # organized in the standard fashion for Tcl tests.
4 #
5 # Copyright (c) 1994 The Regents of the University of California.
6 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
7 # Copyright (c) 1998-1999 by Scriptics Corporation.
8 # All rights reserved.
9
10 package require tcltest 2.2
11 namespace import ::tcltest::*
12 eval tcltest::configure $argv
13 tcltest::loadTestedCommands
14 imageInit
15
16 proc bogusTrace args {
17     error "trace aborted"
18 }
19
20 test button-1.1 {configuration option: "activebackground" for label} -setup {
21     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
22     pack .l
23     update
24 } -body {
25     .l configure -activebackground #012345
26     .l cget -activebackground
27 } -cleanup {
28     destroy .l
29 } -result {#012345}
30 test button-1.2 {configuration option: "activebackground" for label} -setup {
31     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
32     pack .l
33     update
34 } -body {
35     .l configure -activebackground non-existent
36 } -cleanup {
37     destroy .l
38 } -returnCodes {error} -result {unknown color name "non-existent"}
39 test button-1.3 {configuration option: "activebackground" for button} -setup {
40     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
41     pack .b
42     update
43 } -body {
44     .b configure -activebackground #012345
45     .b cget -activebackground
46 } -cleanup {
47     destroy .b
48 } -result {#012345}
49 test button-1.4 {configuration option: "activebackground" for button} -setup {
50     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
51     pack .b
52     update
53 } -body {
54     .b configure -activebackground non-existent
55 } -cleanup {
56     destroy .b
57 } -returnCodes {error} -result {unknown color name "non-existent"}
58 test button-1.5 {configuration option: "activebackground" for checkbutton} -setup {
59     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
60     pack .c
61     update
62 } -body {
63     .c configure -activebackground #012345
64     .c cget -activebackground
65 } -cleanup {
66     destroy .c
67 } -result {#012345}
68 test button-1.6 {configuration option: "activebackground" for checkbutton} -setup {
69     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
70     pack .c
71     update
72 } -body {
73     .c configure -activebackground non-existent
74 } -cleanup {
75     destroy .c
76 } -returnCodes {error} -result {unknown color name "non-existent"}
77 test button-1.7 {configuration option: "activebackground" for radiobutton} -setup {
78     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
79     pack .r
80     update
81 } -body {
82     .r configure -activebackground #012345
83     .r cget -activebackground
84 } -cleanup {
85     destroy .r
86 } -result {#012345}
87 test button-1.8 {configuration option: "activebackground" for radiobutton} -setup {
88     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
89     pack .r
90     update
91 } -body {
92     .r configure -activebackground non-existent
93 } -cleanup {
94     destroy .r
95 } -returnCodes {error} -result {unknown color name "non-existent"}
96
97 test button-1.9 {configuration option: "activeforeground" for label} -setup {
98     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
99     pack .l
100     update
101 } -body {
102     .l configure -activeforeground #ff0000
103     .l cget -activeforeground
104 } -cleanup {
105     destroy .l
106 } -result {#ff0000}
107 test button-1.10 {configuration option: "activeforeground" for label} -setup {
108     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
109     pack .l
110     update
111 } -body {
112     .l configure -activeforeground non-existent
113 } -cleanup {
114     destroy .l
115 } -returnCodes {error} -result {unknown color name "non-existent"}
116 test button-1.11 {configuration option: "activeforeground" for button} -setup {
117     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
118     pack .b
119     update
120 } -body {
121     .b configure -activeforeground #ff0000
122     .b cget -activeforeground
123 } -cleanup {
124     destroy .b
125 } -result {#ff0000}
126 test button-1.12 {configuration option: "activeforeground" for button} -setup {
127     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
128     pack .b
129     update
130 } -body {
131     .b configure -activeforeground non-existent
132 } -cleanup {
133     destroy .b
134 } -returnCodes {error} -result {unknown color name "non-existent"}
135 test button-1.13 {configuration option: "activeforeground" for checkbutton} -setup {
136     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
137     pack .c
138     update
139 } -body {
140     .c configure -activeforeground #ff0000
141     .c cget -activeforeground
142 } -cleanup {
143     destroy .c
144 } -result {#ff0000}
145 test button-1.14 {configuration option: "activeforeground" for checkbutton} -setup {
146     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
147     pack .c
148     update
149 } -body {
150     .c configure -activeforeground non-existent
151 } -cleanup {
152     destroy .c
153 } -returnCodes {error} -result {unknown color name "non-existent"}
154 test button-1.15 {configuration option: "activeforeground" for radiobutton} -setup {
155     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
156     pack .r
157     update
158 } -body {
159     .r configure -activeforeground #ff0000
160     .r cget -activeforeground
161 } -cleanup {
162     destroy .r
163 } -result {#ff0000}
164 test button-1.16 {configuration option: "activeforeground" for radiobutton} -setup {
165     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
166     pack .r
167     update
168 } -body {
169     .r configure -activeforeground non-existent
170 } -cleanup {
171     destroy .r
172 } -returnCodes {error} -result {unknown color name "non-existent"}
173
174 test button-1.17 {configuration option: "anchor" for label} -setup {
175     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
176     pack .l
177     update
178 } -body {
179     .l configure -anchor nw
180     .l cget -anchor
181 } -cleanup {
182     destroy .l
183 } -result {nw}
184 test button-1.18 {configuration option: "anchor" for label} -setup {
185     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
186     pack .l
187     update
188 } -body {
189     .l configure -anchor bogus
190 } -cleanup {
191     destroy .l
192 } -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
193 test button-1.19 {configuration option: "anchor" for button} -setup {
194     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
195     pack .b
196     update
197 } -body {
198     .b configure -anchor nw
199     .b cget -anchor
200 } -cleanup {
201     destroy .b
202 } -result {nw}
203 test button-1.20 {configuration option: "anchor" for button} -setup {
204     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
205     pack .b
206     update
207 } -body {
208     .b configure -anchor bogus
209 } -cleanup {
210     destroy .b
211 } -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
212 test button-1.21 {configuration option: "anchor" for checkbutton} -setup {
213     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
214     pack .c
215     update
216 } -body {
217     .c configure -anchor nw
218     .c cget -anchor
219 } -cleanup {
220     destroy .c
221 } -result {nw}
222 test button-1.22 {configuration option: "anchor" for checkbutton} -setup {
223     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
224     pack .c
225     update
226 } -body {
227     .c configure -anchor bogus
228 } -cleanup {
229     destroy .c
230 } -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
231 test button-1.23 {configuration option: "anchor" for radiobutton} -setup {
232     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
233     pack .r
234     update
235 } -body {
236     .r configure -anchor nw
237     .r cget -anchor
238 } -cleanup {
239     destroy .r
240 } -result {nw}
241 test button-1.24 {configuration option: "anchor" for radiobutton} -setup {
242     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
243     pack .r
244     update
245 } -body {
246     .r configure -anchor bogus
247 } -cleanup {
248     destroy .r
249 } -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
250
251 test button-1.25 {configuration option: "background" for label} -setup {
252     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
253     pack .l
254     update
255 } -body {
256     .l configure -background #ff0000
257     .l cget -background
258 } -cleanup {
259     destroy .l
260 } -result {#ff0000}
261 test button-1.26 {configuration option: "background" for label} -setup {
262     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
263     pack .l
264     update
265 } -body {
266     .l configure -background non-existent
267 } -cleanup {
268     destroy .l
269 } -returnCodes {error} -result {unknown color name "non-existent"}
270 test button-1.27 {configuration option: "background" for button} -setup {
271     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
272     pack .b
273     update
274 } -body {
275     .b configure -background #ff0000
276     .b cget -background
277 } -cleanup {
278     destroy .b
279 } -result {#ff0000}
280 test button-1.28 {configuration option: "background" for button} -setup {
281     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
282     pack .b
283     update
284 } -body {
285     .b configure -background non-existent
286 } -cleanup {
287     destroy .b
288 } -returnCodes {error} -result {unknown color name "non-existent"}
289 test button-1.29 {configuration option: "background" for checkbutton} -setup {
290     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
291     pack .c
292     update
293 } -body {
294     .c configure -background #ff0000
295     .c cget -background
296 } -cleanup {
297     destroy .c
298 } -result {#ff0000}
299 test button-1.30 {configuration option: "background" for checkbutton} -setup {
300     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
301     pack .c
302     update
303 } -body {
304     .c configure -background non-existent
305 } -cleanup {
306     destroy .c
307 } -returnCodes {error} -result {unknown color name "non-existent"}
308 test button-1.31 {configuration option: "background" for radiobutton} -setup {
309     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
310     pack .r
311     update
312 } -body {
313     .r configure -background #ff0000
314     .r cget -background
315 } -cleanup {
316     destroy .r
317 } -result {#ff0000}
318 test button-1.32 {configuration option: "background" for radiobutton} -setup {
319     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
320     pack .r
321     update
322 } -body {
323     .r configure -background non-existent
324 } -cleanup {
325     destroy .r
326 } -returnCodes {error} -result {unknown color name "non-existent"}
327
328 test button-1.33 {configuration option: "bd" for label} -setup {
329     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
330     pack .l
331     update
332 } -body {
333     .l configure -bd 4
334     .l cget -bd
335 } -cleanup {
336     destroy .l
337 } -result {4}
338 test button-1.34 {configuration option: "bd" for label} -setup {
339     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
340     pack .l
341     update
342 } -body {
343     .l configure -bd badValue
344 } -cleanup {
345     destroy .l
346 } -returnCodes {error} -result {bad screen distance "badValue"}
347 test button-1.35 {configuration option: "bd" for button} -setup {
348     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
349     pack .b
350     update
351 } -body {
352     .b configure -bd 4
353     .b cget -bd
354 } -cleanup {
355     destroy .b
356 } -result {4}
357 test button-1.36 {configuration option: "bd" for button} -setup {
358     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
359     pack .b
360     update
361 } -body {
362     .b configure -bd badValue
363 } -cleanup {
364     destroy .b
365 } -returnCodes {error} -result {bad screen distance "badValue"}
366 test button-1.37 {configuration option: "bd" for checkbutton} -setup {
367     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
368     pack .c
369     update
370 } -body {
371     .c configure -bd 4
372     .c cget -bd
373 } -cleanup {
374     destroy .c
375 } -result {4}
376 test button-1.38 {configuration option: "bd" for checkbutton} -setup {
377     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
378     pack .c
379     update
380 } -body {
381     .c configure -bd badValue
382 } -cleanup {
383     destroy .c
384 } -returnCodes {error} -result {bad screen distance "badValue"}
385 test button-1.39 {configuration option: "bd" for radiobutton} -setup {
386     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
387     pack .r
388     update
389 } -body {
390     .r configure -bd 4
391     .r cget -bd
392 } -cleanup {
393     destroy .r
394 } -result {4}
395 test button-1.40 {configuration option: "bd" for radiobutton} -setup {
396     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
397     pack .r
398     update
399 } -body {
400     .r configure -bd badValue
401 } -cleanup {
402     destroy .r
403 } -returnCodes {error} -result {bad screen distance "badValue"}
404
405 test button-1.41 {configuration option: "bg" for label} -setup {
406     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
407     pack .l
408     update
409 } -body {
410     .l configure -bg #ff0000
411     .l cget -bg
412 } -cleanup {
413     destroy .l
414 } -result {#ff0000}
415 test button-1.42 {configuration option: "bg" for label} -setup {
416     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
417     pack .l
418     update
419 } -body {
420     .l configure -bg non-existent
421 } -cleanup {
422     destroy .l
423 } -returnCodes {error} -result {unknown color name "non-existent"}
424 test button-1.43 {configuration option: "bg" for button} -setup {
425     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
426     pack .b
427     update
428 } -body {
429     .b configure -bg #ff0000
430     .b cget -bg
431 } -cleanup {
432     destroy .b
433 } -result {#ff0000}
434 test button-1.44 {configuration option: "bg" for button} -setup {
435     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
436     pack .b
437     update
438 } -body {
439     .b configure -bg non-existent
440 } -cleanup {
441     destroy .b
442 } -returnCodes {error} -result {unknown color name "non-existent"}
443 test button-1.45 {configuration option: "bg" for checkbutton} -setup {
444     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
445     pack .c
446     update
447 } -body {
448     .c configure -bg #ff0000
449     .c cget -bg
450 } -cleanup {
451     destroy .c
452 } -result {#ff0000}
453 test button-1.46 {configuration option: "bg" for checkbutton} -setup {
454     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
455     pack .c
456     update
457 } -body {
458     .c configure -bg non-existent
459 } -cleanup {
460     destroy .c
461 } -returnCodes {error} -result {unknown color name "non-existent"}
462 test button-1.47 {configuration option: "bg" for radiobutton} -setup {
463     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
464     pack .r
465     update
466 } -body {
467     .r configure -bg #ff0000
468     .r cget -bg
469 } -cleanup {
470     destroy .r
471 } -result {#ff0000}
472 test button-1.48 {configuration option: "bg" for radiobutton} -setup {
473     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
474     pack .r
475     update
476 } -body {
477     .r configure -bg non-existent
478 } -cleanup {
479     destroy .r
480 } -returnCodes {error} -result {unknown color name "non-existent"}
481
482 test button-1.49 {configuration option: "bitmap" for label} -setup {
483     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
484     pack .l
485     update
486 } -body {
487     .l configure -bitmap questhead
488     .l cget -bitmap
489 } -cleanup {
490     destroy .l
491 } -result {questhead}
492 test button-1.50 {configuration option: "bitmap" for label} -setup {
493     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
494     pack .l
495     update
496 } -body {
497     .l configure -bitmap badValue
498 } -cleanup {
499     destroy .l
500 } -returnCodes {error} -result {bitmap "badValue" not defined}
501 test button-1.51 {configuration option: "bitmap" for button} -setup {
502     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
503     pack .b
504     update
505 } -body {
506     .b configure -bitmap questhead
507     .b cget -bitmap
508 } -cleanup {
509     destroy .b
510 } -result {questhead}
511 test button-1.52 {configuration option: "bitmap" for button} -setup {
512     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
513     pack .b
514     update
515 } -body {
516     .b configure -bitmap badValue
517 } -cleanup {
518     destroy .b
519 } -returnCodes {error} -result {bitmap "badValue" not defined}
520 test button-1.53 {configuration option: "bitmap" for checkbutton} -setup {
521     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
522     pack .c
523     update
524 } -body {
525     .c configure -bitmap questhead
526     .c cget -bitmap
527 } -cleanup {
528     destroy .c
529 } -result {questhead}
530 test button-1.54 {configuration option: "bitmap" for checkbutton} -setup {
531     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
532     pack .c
533     update
534 } -body {
535     .c configure -bitmap badValue
536 } -cleanup {
537     destroy .c
538 } -returnCodes {error} -result {bitmap "badValue" not defined}
539 test button-1.55 {configuration option: "bitmap" for radiobutton} -setup {
540     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
541     pack .r
542     update
543 } -body {
544     .r configure -bitmap questhead
545     .r cget -bitmap
546 } -cleanup {
547     destroy .r
548 } -result {questhead}
549 test button-1.56 {configuration option: "bitmap" for radiobutton} -setup {
550     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
551     pack .r
552     update
553 } -body {
554     .r configure -bitmap badValue
555 } -cleanup {
556     destroy .r
557 } -returnCodes {error} -result {bitmap "badValue" not defined}
558
559 test button-1.57 {configuration option: "borderwidth" for label} -setup {
560     label .l -highlightthickness 2 -font {Helvetica -12 bold}
561     pack .l
562     update
563 } -body {
564     .l configure -borderwidth 1.3
565     .l cget -borderwidth
566 } -cleanup {
567     destroy .l
568 } -result {1.3}
569 test button-1.58 {configuration option: "borderwidth" for label} -setup {
570     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
571     pack .l
572     update
573 } -body {
574     .l configure -borderwidth badValue
575 } -cleanup {
576     destroy .l
577 } -returnCodes {error} -result {bad screen distance "badValue"}
578 test button-1.59 {configuration option: "borderwidth" for button} -setup {
579     button .b -highlightthickness 2 -font {Helvetica -12 bold}
580     pack .b
581     update
582 } -body {
583     .b configure -borderwidth 1.3
584     .b cget -borderwidth
585 } -cleanup {
586     destroy .b
587 } -result {1.3}
588 test button-1.60 {configuration option: "borderwidth" for button} -setup {
589     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
590     pack .b
591     update
592 } -body {
593     .b configure -borderwidth badValue
594 } -cleanup {
595     destroy .b
596 } -returnCodes {error} -result {bad screen distance "badValue"}
597 test button-1.61 {configuration option: "borderwidth" for checkbutton} -setup {
598     checkbutton .c -highlightthickness 2 -font {Helvetica -12 bold}
599     pack .c
600     update
601 } -body {
602     .c configure -borderwidth 1.3
603     .c cget -borderwidth
604 } -cleanup {
605     destroy .c
606 } -result {1.3}
607 test button-1.62 {configuration option: "borderwidth" for checkbutton} -setup {
608     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
609     pack .c
610     update
611 } -body {
612     .c configure -borderwidth badValue
613 } -cleanup {
614     destroy .c
615 } -returnCodes {error} -result {bad screen distance "badValue"}
616 test button-1.63 {configuration option: "borderwidth" for radiobutton} -setup {
617     radiobutton .r -highlightthickness 2 -font {Helvetica -12 bold}
618     pack .r
619     update
620 } -body {
621     .r configure -borderwidth 1.3
622     .r cget -borderwidth
623 } -cleanup {
624     destroy .r
625 } -result {1.3}
626 test button-1.64 {configuration option: "borderwidth" for radiobutton} -setup {
627     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
628     pack .r
629     update
630 } -body {
631     .r configure -borderwidth badValue
632 } -cleanup {
633     destroy .r
634 } -returnCodes {error} -result {bad screen distance "badValue"}
635
636 test button-1.65 {configuration option: "command" for button} -setup {
637     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
638     pack .b
639     update
640 } -body {
641     .b configure -command {set x}
642     .b cget -command
643 } -cleanup {
644     destroy .b
645 } -result {set x}
646 test button-1.66 {configuration option: "command" for button} -setup {
647     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
648     pack .b
649     update
650 } -body {
651     .b configure -command {set x}
652     .b cget -command
653 } -cleanup {
654     destroy .b
655 } -result {set x}
656 test button-1.67 {configuration option: "command" for checkbutton} -setup {
657     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
658     pack .c
659     update
660 } -body {
661     .c configure -command {set x}
662     .c cget -command
663 } -cleanup {
664     destroy .c
665 } -result {set x}
666 test button-1.68 {configuration option: "command" for radiobutton} -setup {
667     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
668     pack .r
669     update
670 } -body {
671     .r configure -command {set x}
672     .r cget -command
673 } -cleanup {
674     destroy .r
675 } -result {set x}
676
677 test button-1.69 {configuration option: "compound" for label} -setup {
678     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
679     pack .l
680     update
681 } -body {
682     .l configure -compound left
683     .l cget -compound
684 } -cleanup {
685     destroy .l
686 } -result {left}
687 test button-1.70 {configuration option: "compound" for label} -setup {
688     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
689     pack .l
690     update
691 } -body {
692     .l configure -compound bogus
693 } -cleanup {
694     destroy .l
695 } -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
696 test button-1.71 {configuration option: "compound" for button} -setup {
697     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
698     pack .b
699     update
700 } -body {
701     .b configure -compound left
702     .b cget -compound
703 } -cleanup {
704     destroy .b
705 } -result {left}
706 test button-1.72 {configuration option: "compound" for button} -setup {
707     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
708     pack .b
709     update
710 } -body {
711     .b configure -compound bogus
712 } -cleanup {
713     destroy .b
714 } -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
715 test button-1.73 {configuration option: "compound" for checkbutton} -setup {
716     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
717     pack .c
718     update
719 } -body {
720     .c configure -compound left
721     .c cget -compound
722 } -cleanup {
723     destroy .c
724 } -result {left}
725 test button-1.74 {configuration option: "compound" for checkbutton} -setup {
726     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
727     pack .c
728     update
729 } -body {
730     .c configure -compound bogus
731 } -cleanup {
732     destroy .c
733 } -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
734 test button-1.75 {configuration option: "compound" for radiobutton} -setup {
735     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
736     pack .r
737     update
738 } -body {
739     .r configure -compound left
740     .r cget -compound
741 } -cleanup {
742     destroy .r
743 } -result {left}
744 test button-1.76 {configuration option: "compound" for radiobutton} -setup {
745     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
746     pack .r
747     update
748 } -body {
749     .r configure -compound bogus
750 } -cleanup {
751     destroy .r
752 } -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
753
754 test button-1.77 {configuration option: "cursor" for label} -setup {
755     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
756     pack .l
757     update
758 } -body {
759     .l configure -cursor arrow
760     .l cget -cursor
761 } -cleanup {
762     destroy .l
763 } -result {arrow}
764 test button-1.78 {configuration option: "cursor" for label} -setup {
765     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
766     pack .l
767     update
768 } -body {
769     .l configure -cursor badValue
770 } -cleanup {
771     destroy .l
772 } -returnCodes {error} -result {bad cursor spec "badValue"}
773 test button-1.79 {configuration option: "cursor" for button} -setup {
774     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
775     pack .b
776     update
777 } -body {
778     .b configure -cursor arrow
779     .b cget -cursor
780 } -cleanup {
781     destroy .b
782 } -result {arrow}
783 test button-1.80 {configuration option: "cursor" for button} -setup {
784     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
785     pack .b
786     update
787 } -body {
788     .b configure -cursor badValue
789 } -cleanup {
790     destroy .b
791 } -returnCodes {error} -result {bad cursor spec "badValue"}
792 test button-1.81 {configuration option: "cursor" for checkbutton} -setup {
793     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
794     pack .c
795     update
796 } -body {
797     .c configure -cursor arrow
798     .c cget -cursor
799 } -cleanup {
800     destroy .c
801 } -result {arrow}
802 test button-1.82 {configuration option: "cursor" for checkbutton} -setup {
803     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
804     pack .c
805     update
806 } -body {
807     .c configure -cursor badValue
808 } -cleanup {
809     destroy .c
810 } -returnCodes {error} -result {bad cursor spec "badValue"}
811 test button-1.83 {configuration option: "cursor" for radiobutton} -setup {
812     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
813     pack .r
814     update
815 } -body {
816     .r configure -cursor arrow
817     .r cget -cursor
818 } -cleanup {
819     destroy .r
820 } -result {arrow}
821 test button-1.84 {configuration option: "cursor" for radiobutton} -setup {
822     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
823     pack .r
824     update
825 } -body {
826     .r configure -cursor badValue
827 } -cleanup {
828     destroy .r
829 } -returnCodes {error} -result {bad cursor spec "badValue"}
830
831 test button-1.85 {configuration option: "default" for button} -setup {
832     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
833     pack .b
834     update
835 } -body {
836     .b configure -default active
837     .b cget -default
838 } -cleanup {
839     destroy .b
840 } -result {active}
841 test button-1.86 {configuration option: "default" for button} -setup {
842     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
843     pack .b
844     update
845 } -body {
846     .b configure -default huh?
847 } -cleanup {
848     destroy .b
849 } -returnCodes {error} -result {bad default "huh?": must be active, disabled, or normal}
850
851 test button-1.87 {configuration option: "disabledforeground" for label} -setup {
852     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
853     pack .l
854     update
855 } -body {
856     .l configure -disabledforeground #00ff00
857     .l cget -disabledforeground
858 } -cleanup {
859     destroy .l
860 } -result {#00ff00}
861 test button-1.88 {configuration option: "disabledforeground" for label} -setup {
862     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
863     pack .l
864     update
865 } -body {
866     .l configure -disabledforeground non-existent
867 } -cleanup {
868     destroy .l
869 } -returnCodes {error} -result {unknown color name "non-existent"}
870 test button-1.89 {configuration option: "disabledforeground" for button} -setup {
871     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
872     pack .b
873     update
874 } -body {
875     .b configure -disabledforeground #00ff00
876     .b cget -disabledforeground
877 } -cleanup {
878     destroy .b
879 } -result {#00ff00}
880 test button-1.90 {configuration option: "disabledforeground" for button} -setup {
881     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
882     pack .b
883     update
884 } -body {
885     .b configure -disabledforeground non-existent
886 } -cleanup {
887     destroy .b
888 } -returnCodes {error} -result {unknown color name "non-existent"}
889 test button-1.91 {configuration option: "disabledforeground" for checkbutton} -setup {
890     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
891     pack .c
892     update
893 } -body {
894     .c configure -disabledforeground #00ff00
895     .c cget -disabledforeground
896 } -cleanup {
897     destroy .c
898 } -result {#00ff00}
899 test button-1.92 {configuration option: "disabledforeground" for checkbutton} -setup {
900     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
901     pack .c
902     update
903 } -body {
904     .c configure -disabledforeground non-existent
905 } -cleanup {
906     destroy .c
907 } -returnCodes {error} -result {unknown color name "non-existent"}
908 test button-1.93 {configuration option: "disabledforeground" for radiobutton} -setup {
909     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
910     pack .r
911     update
912 } -body {
913     .r configure -disabledforeground #00ff00
914     .r cget -disabledforeground
915 } -cleanup {
916     destroy .r
917 } -result {#00ff00}
918 test button-1.94 {configuration option: "disabledforeground" for radiobutton} -setup {
919     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
920     pack .r
921     update
922 } -body {
923     .r configure -disabledforeground non-existent
924 } -cleanup {
925     destroy .r
926 } -returnCodes {error} -result {unknown color name "non-existent"}
927
928 test button-1.95 {configuration option: "fg" for label} -setup {
929     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
930     pack .l
931     update
932 } -body {
933     .l configure -fg #110022
934     .l cget -fg
935 } -cleanup {
936     destroy .l
937 } -result {#110022}
938 test button-1.96 {configuration option: "fg" for label} -setup {
939     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
940     pack .l
941     update
942 } -body {
943     .l configure -fg non-existent
944 } -cleanup {
945     destroy .l
946 } -returnCodes {error} -result {unknown color name "non-existent"}
947 test button-1.97 {configuration option: "fg" for button} -setup {
948     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
949     pack .b
950     update
951 } -body {
952     .b configure -fg #110022
953     .b cget -fg
954 } -cleanup {
955     destroy .b
956 } -result {#110022}
957 test button-1.98 {configuration option: "fg" for button} -setup {
958     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
959     pack .b
960     update
961 } -body {
962     .b configure -fg non-existent
963 } -cleanup {
964     destroy .b
965 } -returnCodes {error} -result {unknown color name "non-existent"}
966 test button-1.99 {configuration option: "fg" for checkbutton} -setup {
967     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
968     pack .c
969     update
970 } -body {
971     .c configure -fg #110022
972     .c cget -fg
973 } -cleanup {
974     destroy .c
975 } -result {#110022}
976 test button-1.100 {configuration option: "fg" for checkbutton} -setup {
977     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
978     pack .c
979     update
980 } -body {
981     .c configure -fg non-existent
982 } -cleanup {
983     destroy .c
984 } -returnCodes {error} -result {unknown color name "non-existent"}
985 test button-1.101 {configuration option: "fg" for radiobutton} -setup {
986     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
987     pack .r
988     update
989 } -body {
990     .r configure -fg #110022
991     .r cget -fg
992 } -cleanup {
993     destroy .r
994 } -result {#110022}
995 test button-1.102 {configuration option: "fg" for radiobutton} -setup {
996     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
997     pack .r
998     update
999 } -body {
1000     .r configure -fg non-existent
1001 } -cleanup {
1002     destroy .r
1003 } -returnCodes {error} -result {unknown color name "non-existent"}
1004
1005 test button-1.103 {configuration option: "font" for label} -setup {
1006     label .l -borderwidth 2 -highlightthickness 2
1007     pack .l
1008     update
1009 } -body {
1010     .l configure -font {Helvetica -12}
1011     .l cget -font
1012 } -cleanup {
1013     destroy .l
1014 } -result {Helvetica -12}
1015 test button-1.104 {configuration option: "activebackground" for label} -setup {
1016     label .l -borderwidth 2 -highlightthickness 2
1017     pack .l
1018     update
1019 } -body {
1020     .l configure -font {}
1021 } -cleanup {
1022     destroy .l
1023 } -returnCodes {error} -result {font "" doesn't exist}
1024 test button-1.105 {configuration option: "font" for button} -setup {
1025     button .b -borderwidth 2 -highlightthickness 2
1026     pack .b
1027     update
1028 } -body {
1029     .b configure -font {Helvetica -12}
1030     .b cget -font
1031 } -cleanup {
1032     destroy .b
1033 } -result {Helvetica -12}
1034 test button-1.106 {configuration option: "activebackground" for button} -setup {
1035     button .b -borderwidth 2 -highlightthickness 2
1036     pack .b
1037     update
1038 } -body {
1039     .b configure -font {}
1040 } -cleanup {
1041     destroy .b
1042 } -returnCodes {error} -result {font "" doesn't exist}
1043 test button-1.107 {configuration option: "font" for checkbutton} -setup {
1044     checkbutton .c -borderwidth 2 -highlightthickness 2
1045     pack .c
1046     update
1047 } -body {
1048     .c configure -font {Helvetica -12}
1049     .c cget -font
1050 } -cleanup {
1051     destroy .c
1052 } -result {Helvetica -12}
1053 test button-1.108 {configuration option: "activebackground" for checkbutton} -setup {
1054     checkbutton .c -borderwidth 2 -highlightthickness 2
1055     pack .c
1056     update
1057 } -body {
1058     .c configure -font {}
1059 } -cleanup {
1060     destroy .c
1061 } -returnCodes {error} -result {font "" doesn't exist}
1062 test button-1.109 {configuration option: "font" for radiobutton} -setup {
1063     radiobutton .r -borderwidth 2 -highlightthickness 2
1064     pack .r
1065     update
1066 } -body {
1067     .r configure -font {Helvetica -12}
1068     .r cget -font
1069 } -cleanup {
1070     destroy .r
1071 } -result {Helvetica -12}
1072 test button-1.110 {configuration option: "activebackground" for radiobutton} -setup {
1073     radiobutton .r -borderwidth 2 -highlightthickness 2
1074     pack .r
1075     update
1076 } -body {
1077     .r configure -font {}
1078 } -cleanup {
1079     destroy .r
1080 } -returnCodes {error} -result {font "" doesn't exist}
1081
1082 test button-1.111 {configuration option: "foreground" for label} -setup {
1083     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1084     pack .l
1085     update
1086 } -body {
1087     .l configure -foreground #110022
1088     .l cget -foreground
1089 } -cleanup {
1090     destroy .l
1091 } -result {#110022}
1092 test button-1.112 {configuration option: "foreground" for label} -setup {
1093     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1094     pack .l
1095     update
1096 } -body {
1097     .l configure -foreground non-existent
1098 } -cleanup {
1099     destroy .l
1100 } -returnCodes {error} -result {unknown color name "non-existent"}
1101 test button-1.113 {configuration option: "foreground" for button} -setup {
1102     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1103     pack .b
1104     update
1105 } -body {
1106     .b configure -foreground #110022
1107     .b cget -foreground
1108 } -cleanup {
1109     destroy .b
1110 } -result {#110022}
1111 test button-1.114 {configuration option: "foreground" for button} -setup {
1112     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1113     pack .b
1114     update
1115 } -body {
1116     .b configure -foreground non-existent
1117 } -cleanup {
1118     destroy .b
1119 } -returnCodes {error} -result {unknown color name "non-existent"}
1120 test button-1.115 {configuration option: "foreground" for checkbutton} -setup {
1121     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1122     pack .c
1123     update
1124 } -body {
1125     .c configure -foreground #110022
1126     .c cget -foreground
1127 } -cleanup {
1128     destroy .c
1129 } -result {#110022}
1130 test button-1.116 {configuration option: "foreground" for checkbutton} -setup {
1131     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1132     pack .c
1133     update
1134 } -body {
1135     .c configure -foreground non-existent
1136 } -cleanup {
1137     destroy .c
1138 } -returnCodes {error} -result {unknown color name "non-existent"}
1139 test button-1.117 {configuration option: "foreground" for radiobutton} -setup {
1140     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1141     pack .r
1142     update
1143 } -body {
1144     .r configure -foreground #110022
1145     .r cget -foreground
1146 } -cleanup {
1147     destroy .r
1148 } -result {#110022}
1149 test button-1.118 {configuration option: "foreground" for radiobutton} -setup {
1150     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1151     pack .r
1152     update
1153 } -body {
1154     .r configure -foreground non-existent
1155 } -cleanup {
1156     destroy .r
1157 } -returnCodes {error} -result {unknown color name "non-existent"}
1158
1159 test button-1.119 {configuration option: "height" for label} -setup {
1160     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1161     pack .l
1162     update
1163 } -body {
1164     .l configure -height 18
1165     .l cget -height
1166 } -cleanup {
1167     destroy .l
1168 } -result {18}
1169 test button-1.120 {configuration option: "height" for label} -setup {
1170     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1171     pack .l
1172     update
1173 } -body {
1174     .l configure -height 20.0
1175 } -cleanup {
1176     destroy .l
1177 } -returnCodes {error} -result {expected integer but got "20.0"}
1178 test button-1.121 {configuration option: "height" for button} -setup {
1179     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1180     pack .b
1181     update
1182 } -body {
1183     .b configure -height 18
1184     .b cget -height
1185 } -cleanup {
1186     destroy .b
1187 } -result {18}
1188 test button-1.122 {configuration option: "height" for button} -setup {
1189     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1190     pack .b
1191     update
1192 } -body {
1193     .b configure -height 20.0
1194 } -cleanup {
1195     destroy .b
1196 } -returnCodes {error} -result {expected integer but got "20.0"}
1197 test button-1.123 {configuration option: "height" for checkbutton} -setup {
1198     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1199     pack .c
1200     update
1201 } -body {
1202     .c configure -height 18
1203     .c cget -height
1204 } -cleanup {
1205     destroy .c
1206 } -result {18}
1207 test button-1.124 {configuration option: "height" for checkbutton} -setup {
1208     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1209     pack .c
1210     update
1211 } -body {
1212     .c configure -height 20.0
1213 } -cleanup {
1214     destroy .c
1215 } -returnCodes {error} -result {expected integer but got "20.0"}
1216 test button-1.125 {configuration option: "height" for radiobutton} -setup {
1217     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1218     pack .r
1219     update
1220 } -body {
1221     .r configure -height 18
1222     .r cget -height
1223 } -cleanup {
1224     destroy .r
1225 } -result {18}
1226 test button-1.126 {configuration option: "height" for radiobutton} -setup {
1227     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1228     pack .r
1229     update
1230 } -body {
1231     .r configure -height 20.0
1232 } -cleanup {
1233     destroy .r
1234 } -returnCodes {error} -result {expected integer but got "20.0"}
1235
1236 test button-1.127 {configuration option: "highlightbackground" for label} -setup {
1237     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1238     pack .l
1239     update
1240 } -body {
1241     .l configure -highlightbackground #110022
1242     .l cget -highlightbackground
1243 } -cleanup {
1244     destroy .l
1245 } -result {#110022}
1246 test button-1.128 {configuration option: "highlightbackground" for label} -setup {
1247     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1248     pack .l
1249     update
1250 } -body {
1251     .l configure -highlightbackground non-existent
1252 } -cleanup {
1253     destroy .l
1254 } -returnCodes {error} -result {unknown color name "non-existent"}
1255 test button-1.129 {configuration option: "highlightbackground" for button} -setup {
1256     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1257     pack .b
1258     update
1259 } -body {
1260     .b configure -highlightbackground #110022
1261     .b cget -highlightbackground
1262 } -cleanup {
1263     destroy .b
1264 } -result {#110022}
1265 test button-1.130 {configuration option: "highlightbackground" for button} -setup {
1266     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1267     pack .b
1268     update
1269 } -body {
1270     .b configure -highlightbackground non-existent
1271 } -cleanup {
1272     destroy .b
1273 } -returnCodes {error} -result {unknown color name "non-existent"}
1274 test button-1.131 {configuration option: "highlightbackground" for checkbutton} -setup {
1275     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1276     pack .c
1277     update
1278 } -body {
1279     .c configure -highlightbackground #110022
1280     .c cget -highlightbackground
1281 } -cleanup {
1282     destroy .c
1283 } -result {#110022}
1284 test button-1.132 {configuration option: "highlightbackground" for checkbutton} -setup {
1285     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1286     pack .c
1287     update
1288 } -body {
1289     .c configure -highlightbackground non-existent
1290 } -cleanup {
1291     destroy .c
1292 } -returnCodes {error} -result {unknown color name "non-existent"}
1293 test button-1.133 {configuration option: "highlightbackground" for radiobutton} -setup {
1294     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1295     pack .r
1296     update
1297 } -body {
1298     .r configure -highlightbackground #110022
1299     .r cget -highlightbackground
1300 } -cleanup {
1301     destroy .r
1302 } -result {#110022}
1303 test button-1.134 {configuration option: "highlightbackground" for radiobutton} -setup {
1304     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1305     pack .r
1306     update
1307 } -body {
1308     .r configure -highlightbackground non-existent
1309 } -cleanup {
1310     destroy .r
1311 } -returnCodes {error} -result {unknown color name "non-existent"}
1312
1313 test button-1.135 {configuration option: "highlightcolor" for label} -setup {
1314     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1315     pack .l
1316     update
1317 } -body {
1318     .l configure -highlightcolor #110022
1319     .l cget -highlightcolor
1320 } -cleanup {
1321     destroy .l
1322 } -result {#110022}
1323 test button-1.136 {configuration option: "highlightcolor" for label} -setup {
1324     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1325     pack .l
1326     update
1327 } -body {
1328     .l configure -highlightcolor non-existent
1329 } -cleanup {
1330     destroy .l
1331 } -returnCodes {error} -result {unknown color name "non-existent"}
1332 test button-1.137 {configuration option: "highlightcolor" for button} -setup {
1333     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1334     pack .b
1335     update
1336 } -body {
1337     .b configure -highlightcolor #110022
1338     .b cget -highlightcolor
1339 } -cleanup {
1340     destroy .b
1341 } -result {#110022}
1342 test button-1.138 {configuration option: "highlightcolor" for button} -setup {
1343     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1344     pack .b
1345     update
1346 } -body {
1347     .b configure -highlightcolor non-existent
1348 } -cleanup {
1349     destroy .b
1350 } -returnCodes {error} -result {unknown color name "non-existent"}
1351 test button-1.139 {configuration option: "highlightcolor" for checkbutton} -setup {
1352     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1353     pack .c
1354     update
1355 } -body {
1356     .c configure -highlightcolor #110022
1357     .c cget -highlightcolor
1358 } -cleanup {
1359     destroy .c
1360 } -result {#110022}
1361 test button-1.140 {configuration option: "highlightcolor" for checkbutton} -setup {
1362     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1363     pack .c
1364     update
1365 } -body {
1366     .c configure -highlightcolor non-existent
1367 } -cleanup {
1368     destroy .c
1369 } -returnCodes {error} -result {unknown color name "non-existent"}
1370 test button-1.141 {configuration option: "highlightcolor" for radiobutton} -setup {
1371     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1372     pack .r
1373     update
1374 } -body {
1375     .r configure -highlightcolor #110022
1376     .r cget -highlightcolor
1377 } -cleanup {
1378     destroy .r
1379 } -result {#110022}
1380 test button-1.142 {configuration option: "highlightcolor" for radiobutton} -setup {
1381     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1382     pack .r
1383     update
1384 } -body {
1385     .r configure -highlightcolor non-existent
1386 } -cleanup {
1387     destroy .r
1388 } -returnCodes {error} -result {unknown color name "non-existent"}
1389
1390 test button-1.143 {configuration option: "highlightthickness" for label} -setup {
1391     label .l -borderwidth 2 -font {Helvetica -12 bold}
1392     pack .l
1393     update
1394 } -body {
1395     .l configure -highlightthickness 6m
1396     .l cget -highlightthickness
1397 } -cleanup {
1398     destroy .l
1399 } -result {6m}
1400 test button-1.144 {configuration option: "highlightthickness" for label} -setup {
1401     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1402     pack .l
1403     update
1404 } -body {
1405     .l configure -highlightthickness badValue
1406 } -cleanup {
1407     destroy .l
1408 } -returnCodes {error} -result {bad screen distance "badValue"}
1409 test button-1.145 {configuration option: "highlightthickness" for button} -setup {
1410     button .b -borderwidth 2 -font {Helvetica -12 bold}
1411     pack .b
1412     update
1413 } -body {
1414     .b configure -highlightthickness 6m
1415     .b cget -highlightthickness
1416 } -cleanup {
1417     destroy .b
1418 } -result {6m}
1419 test button-1.146 {configuration option: "highlightthickness" for button} -setup {
1420     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1421     pack .b
1422     update
1423 } -body {
1424     .b configure -highlightthickness badValue
1425 } -cleanup {
1426     destroy .b
1427 } -returnCodes {error} -result {bad screen distance "badValue"}
1428 test button-1.147 {configuration option: "highlightthickness" for checkbutton} -setup {
1429     checkbutton .c -borderwidth 2 -font {Helvetica -12 bold}
1430     pack .c
1431     update
1432 } -body {
1433     .c configure -highlightthickness 6m
1434     .c cget -highlightthickness
1435 } -cleanup {
1436     destroy .c
1437 } -result {6m}
1438 test button-1.148 {configuration option: "highlightthickness" for checkbutton} -setup {
1439     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1440     pack .c
1441     update
1442 } -body {
1443     .c configure -highlightthickness badValue
1444 } -cleanup {
1445     destroy .c
1446 } -returnCodes {error} -result {bad screen distance "badValue"}
1447 test button-1.149 {configuration option: "highlightthickness" for radiobutton} -setup {
1448     radiobutton .r -borderwidth 2 -font {Helvetica -12 bold}
1449     pack .r
1450     update
1451 } -body {
1452     .r configure -highlightthickness 6m
1453     .r cget -highlightthickness
1454 } -cleanup {
1455     destroy .r
1456 } -result {6m}
1457 test button-1.150 {configuration option: "highlightthickness" for radiobutton} -setup {
1458     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1459     pack .r
1460     update
1461 } -body {
1462     .r configure -highlightthickness badValue
1463 } -cleanup {
1464     destroy .r
1465 } -returnCodes {error} -result {bad screen distance "badValue"}
1466
1467 test button-1.151 {configuration option: "image" for label} -constraints {
1468     testImageType
1469 } -setup {
1470     image create test image1
1471     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1472     pack .l
1473     update
1474 } -body {
1475     .l configure -image image1
1476     .l cget -image
1477 } -cleanup {
1478     destroy .l
1479     image delete image1
1480 } -result {image1}
1481 test button-1.152 {configuration option: "image" for label} -setup {
1482     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1483     pack .l
1484     update
1485 } -body {
1486     .l configure -image bogus
1487 } -cleanup {
1488     destroy .l
1489 } -returnCodes {error} -result {image "bogus" doesn't exist}
1490 test button-1.153 {configuration option: "image" for button} -constraints {
1491     testImageType
1492 } -setup {
1493     image create test image1
1494     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1495     pack .b
1496     update
1497 } -body {
1498     .b configure -image image1
1499     .b cget -image
1500 } -cleanup {
1501     destroy .b
1502     image delete image1
1503 } -result {image1}
1504 test button-1.154 {configuration option: "image" for button} -setup {
1505     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1506     pack .b
1507     update
1508 } -body {
1509     .b configure -image bogus
1510 } -cleanup {
1511     destroy .b
1512 } -returnCodes {error} -result {image "bogus" doesn't exist}
1513 test button-1.155 {configuration option: "image" for checkbutton} -constraints {
1514     testImageType
1515 } -setup {
1516     image create test image1
1517     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1518     pack .c
1519     update
1520 } -body {
1521     .c configure -image image1
1522     .c cget -image
1523 } -cleanup {
1524     destroy .c
1525     image delete image1
1526 } -result {image1}
1527 test button-1.156 {configuration option: "image" for checkbutton} -setup {
1528     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1529     pack .c
1530     update
1531 } -body {
1532     .c configure -image bogus
1533 } -cleanup {
1534     destroy .c
1535 } -returnCodes {error} -result {image "bogus" doesn't exist}
1536 test button-1.157 {configuration option: "image" for radiobutton} -constraints {
1537     testImageType
1538 } -setup {
1539     image create test image1
1540     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1541     pack .r
1542     update
1543 } -body {
1544     .r configure -image image1
1545     .r cget -image
1546 } -cleanup {
1547     destroy .r
1548     image delete image1
1549 } -result {image1}
1550 test button-1.158 {configuration option: "image" for radiobutton} -setup {
1551     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1552     pack .r
1553     update
1554 } -body {
1555     .r configure -image bogus
1556 } -cleanup {
1557     destroy .r
1558 } -returnCodes {error} -result {image "bogus" doesn't exist}
1559
1560 test button-1.159 {configuration option: "indicatoron" for checkbutton} -setup {
1561     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1562     pack .c
1563     update
1564 } -body {
1565     .c configure -indicatoron yes
1566     .c cget -indicatoron
1567 } -cleanup {
1568     destroy .c
1569 } -result {1}
1570 test button-1.160 {configuration option: "indicatoron" for checkbutton} -setup {
1571     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1572     pack .c
1573     update
1574 } -body {
1575     .c configure -indicatoron no_way
1576 } -cleanup {
1577     destroy .c
1578 } -returnCodes {error} -result {expected boolean value but got "no_way"}
1579 test button-1.161 {configuration option: "indicatoron" for radiobutton} -setup {
1580     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1581     pack .r
1582     update
1583 } -body {
1584     .r configure -indicatoron yes
1585     .r cget -indicatoron
1586 } -cleanup {
1587     destroy .r
1588 } -result {1}
1589 test button-1.162 {configuration option: "indicatoron" for radiobutton} -setup {
1590     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1591     pack .r
1592     update
1593 } -body {
1594     .r configure -indicatoron no_way
1595 } -cleanup {
1596     destroy .r
1597 } -returnCodes {error} -result {expected boolean value but got "no_way"}
1598
1599 test button-1.163 {configuration option: "justify" for label} -setup {
1600     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1601     pack .l
1602     update
1603 } -body {
1604     .l configure -justify right
1605     .l cget -justify
1606 } -cleanup {
1607     destroy .l
1608 } -result {right}
1609 test button-1.164 {configuration option: "justify" for label} -setup {
1610     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1611     pack .l
1612     update
1613 } -body {
1614     .l configure -justify bogus
1615 } -cleanup {
1616     destroy .l
1617 } -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
1618 test button-1.165 {configuration option: "justify" for button} -setup {
1619     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1620     pack .b
1621     update
1622 } -body {
1623     .b configure -justify right
1624     .b cget -justify
1625 } -cleanup {
1626     destroy .b
1627 } -result {right}
1628 test button-1.166 {configuration option: "justify" for button} -setup {
1629     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1630     pack .b
1631     update
1632 } -body {
1633     .b configure -justify bogus
1634 } -cleanup {
1635     destroy .b
1636 } -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
1637 test button-1.167 {configuration option: "justify" for checkbutton} -setup {
1638     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1639     pack .c
1640     update
1641 } -body {
1642     .c configure -justify right
1643     .c cget -justify
1644 } -cleanup {
1645     destroy .c
1646 } -result {right}
1647 test button-1.168 {configuration option: "justify" for checkbutton} -setup {
1648     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1649     pack .c
1650     update
1651 } -body {
1652     .c configure -justify bogus
1653 } -cleanup {
1654     destroy .c
1655 } -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
1656 test button-1.169 {configuration option: "justify" for radiobutton} -setup {
1657     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1658     pack .r
1659     update
1660 } -body {
1661     .r configure -justify right
1662     .r cget -justify
1663 } -cleanup {
1664     destroy .r
1665 } -result {right}
1666 test button-1.170 {configuration option: "justify" for radiobutton} -setup {
1667     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1668     pack .r
1669     update
1670 } -body {
1671     .r configure -justify bogus
1672 } -cleanup {
1673     destroy .r
1674 } -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
1675
1676 test button-1.171 {configuration option: "offrelief" for checkbutton} -setup {
1677     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1678     pack .c
1679     update
1680 } -body {
1681     .c configure -offrelief flat
1682     .c cget -offrelief
1683 } -cleanup {
1684     destroy .c
1685 } -result {flat}
1686 test button-1.172 {configuration option: "offrelief" for checkbutton} -setup {
1687     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1688     pack .c
1689     update
1690 } -body {
1691     .c configure -offrelief 1.5
1692 } -cleanup {
1693     destroy .c
1694 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1695 test button-1.173 {configuration option: "offrelief" for radiobutton} -setup {
1696     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1697     pack .r
1698     update
1699 } -body {
1700     .r configure -offrelief flat
1701     .r cget -offrelief
1702 } -cleanup {
1703     destroy .r
1704 } -result {flat}
1705 test button-1.174 {configuration option: "offrelief" for radiobutton} -setup {
1706     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1707     pack .r
1708     update
1709 } -body {
1710     .r configure -offrelief 1.5
1711 } -cleanup {
1712     destroy .r
1713 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1714
1715 test button-1.175 {configuration option: "offvalue" for checkbutton} -setup {
1716     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1717     pack .c
1718     update
1719 } -body {
1720     .c configure -offvalue lousy
1721     .c cget -offvalue
1722 } -cleanup {
1723     destroy .c
1724 } -result {lousy}
1725
1726 test button-1.176 {configuration option: "onvalue" for checkbutton} -setup {
1727     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1728     pack .c
1729     update
1730 } -body {
1731     .c configure -onvalue fantastic
1732     .c cget -onvalue
1733 } -cleanup {
1734     destroy .c
1735 } -result {fantastic}
1736
1737 test button-1.177 {configuration option: "overrelief" for button} -setup {
1738     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1739     pack .b
1740     update
1741 } -body {
1742     .b configure -overrelief ""
1743     .b cget -overrelief
1744 } -cleanup {
1745     destroy .b
1746 } -result {}
1747 test button-1.178 {configuration option: "overrelief" for button} -setup {
1748     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1749     pack .b
1750     update
1751 } -body {
1752     .b configure -overrelief 1.5
1753 } -cleanup {
1754     destroy .b
1755 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1756 test button-1.179 {configuration option: "overrelief" for checkbutton} -setup {
1757     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1758     pack .c
1759     update
1760 } -body {
1761     .c configure -overrelief ""
1762     .c cget -overrelief
1763 } -cleanup {
1764     destroy .c
1765 } -result {}
1766 test button-1.180 {configuration option: "overrelief" for checkbutton} -setup {
1767     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1768     pack .c
1769     update
1770 } -body {
1771     .c configure -overrelief 1.5
1772 } -cleanup {
1773     destroy .c
1774 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1775 test button-1.181 {configuration option: "overrelief" for radiobutton} -setup {
1776     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1777     pack .r
1778     update
1779 } -body {
1780     .r configure -overrelief ""
1781     .r cget -overrelief
1782 } -cleanup {
1783     destroy .r
1784 } -result {}
1785 test button-1.182 {configuration option: "overrelief" for radiobutton} -setup {
1786     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1787     pack .r
1788     update
1789 } -body {
1790     .r configure -overrelief 1.5
1791 } -cleanup {
1792     destroy .r
1793 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1794
1795 test button-1.183 {configuration option: "padx" for label} -setup {
1796     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1797     pack .l
1798     update
1799 } -body {
1800     .l configure -padx 12m
1801     .l cget -padx
1802 } -cleanup {
1803     destroy .l
1804 } -result {12m}
1805 test button-1.184 {configuration option: "padx" for label} -setup {
1806     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1807     pack .l
1808     update
1809 } -body {
1810     .l configure -padx 420x
1811 } -cleanup {
1812     destroy .l
1813 } -returnCodes {error} -result {bad screen distance "420x"}
1814 test button-1.185 {configuration option: "padx" for button} -setup {
1815     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1816     pack .b
1817     update
1818 } -body {
1819     .b configure -padx 12m
1820     .b cget -padx
1821 } -cleanup {
1822     destroy .b
1823 } -result {12m}
1824 test button-1.186 {configuration option: "padx" for button} -setup {
1825     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1826     pack .b
1827     update
1828 } -body {
1829     .b configure -padx 420x
1830 } -cleanup {
1831     destroy .b
1832 } -returnCodes {error} -result {bad screen distance "420x"}
1833 test button-1.187 {configuration option: "padx" for checkbutton} -setup {
1834     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1835     pack .c
1836     update
1837 } -body {
1838     .c configure -padx 12m
1839     .c cget -padx
1840 } -cleanup {
1841     destroy .c
1842 } -result {12m}
1843 test button-1.188 {configuration option: "padx" for checkbutton} -setup {
1844     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1845     pack .c
1846     update
1847 } -body {
1848     .c configure -padx 420x
1849 } -cleanup {
1850     destroy .c
1851 } -returnCodes {error} -result {bad screen distance "420x"}
1852 test button-1.189 {configuration option: "padx" for radiobutton} -setup {
1853     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1854     pack .r
1855     update
1856 } -body {
1857     .r configure -padx 12m
1858     .r cget -padx
1859 } -cleanup {
1860     destroy .r
1861 } -result {12m}
1862 test button-1.190 {configuration option: "padx" for radiobutton} -setup {
1863     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1864     pack .r
1865     update
1866 } -body {
1867     .r configure -padx 420x
1868 } -cleanup {
1869     destroy .r
1870 } -returnCodes {error} -result {bad screen distance "420x"}
1871
1872 test button-1.191 {configuration option: "pady" for label} -setup {
1873     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1874     pack .l
1875     update
1876 } -body {
1877     .l configure -pady 12m
1878     .l cget -pady
1879 } -cleanup {
1880     destroy .l
1881 } -result {12m}
1882 test button-1.192 {configuration option: "pady" for label} -setup {
1883     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1884     pack .l
1885     update
1886 } -body {
1887     .l configure -pady 420x
1888 } -cleanup {
1889     destroy .l
1890 } -returnCodes {error} -result {bad screen distance "420x"}
1891 test button-1.193 {configuration option: "pady" for button} -setup {
1892     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1893     pack .b
1894     update
1895 } -body {
1896     .b configure -pady 12m
1897     .b cget -pady
1898 } -cleanup {
1899     destroy .b
1900 } -result {12m}
1901 test button-1.194 {configuration option: "pady" for button} -setup {
1902     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1903     pack .b
1904     update
1905 } -body {
1906     .b configure -pady 420x
1907 } -cleanup {
1908     destroy .b
1909 } -returnCodes {error} -result {bad screen distance "420x"}
1910 test button-1.195 {configuration option: "pady" for checkbutton} -setup {
1911     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1912     pack .c
1913     update
1914 } -body {
1915     .c configure -pady 12m
1916     .c cget -pady
1917 } -cleanup {
1918     destroy .c
1919 } -result {12m}
1920 test button-1.196 {configuration option: "pady" for checkbutton} -setup {
1921     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1922     pack .c
1923     update
1924 } -body {
1925     .c configure -pady 420x
1926 } -cleanup {
1927     destroy .c
1928 } -returnCodes {error} -result {bad screen distance "420x"}
1929 test button-1.197 {configuration option: "pady" for radiobutton} -setup {
1930     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1931     pack .r
1932     update
1933 } -body {
1934     .r configure -pady 12m
1935     .r cget -pady
1936 } -cleanup {
1937     destroy .r
1938 } -result {12m}
1939 test button-1.198 {configuration option: "pady" for radiobutton} -setup {
1940     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1941     pack .r
1942     update
1943 } -body {
1944     .r configure -pady 420x
1945 } -cleanup {
1946     destroy .r
1947 } -returnCodes {error} -result {bad screen distance "420x"}
1948
1949 test button-1.199 {configuration option: "repeatdelay" for button} -setup {
1950     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1951     pack .b
1952     update
1953 } -body {
1954     .b configure -repeatdelay 100
1955     .b cget -repeatdelay
1956 } -cleanup {
1957     destroy .b
1958 } -result {100}
1959 test button-1.200 {configuration option: "repeatdelay" for button} -setup {
1960     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1961     pack .b
1962     update
1963 } -body {
1964     .b configure -repeatdelay foo
1965 } -cleanup {
1966     destroy .b
1967 } -returnCodes {error} -result {expected integer but got "foo"}
1968
1969 test button-1.201 {configuration option: "repeatinterval" for button} -setup {
1970     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1971     pack .b
1972     update
1973 } -body {
1974     .b configure -repeatinterval 100
1975     .b cget -repeatinterval
1976 } -cleanup {
1977     destroy .b
1978 } -result {100}
1979 test button-1.202 {configuration option: "repeatinterval" for button} -setup {
1980     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1981     pack .b
1982     update
1983 } -body {
1984     .b configure -repeatinterval foo
1985 } -cleanup {
1986     destroy .b
1987 } -returnCodes {error} -result {expected integer but got "foo"}
1988
1989 test button-1.203 {configuration option: "relief" for label} -setup {
1990     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1991     pack .l
1992     update
1993 } -body {
1994     .l configure -relief flat
1995     .l cget -relief
1996 } -cleanup {
1997     destroy .l
1998 } -result {flat}
1999 test button-1.204 {configuration option: "relief" for label} -setup {
2000     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2001     pack .l
2002     update
2003 } -body {
2004     .l configure -relief 1.5
2005 } -cleanup {
2006     destroy .l
2007 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
2008 test button-1.205 {configuration option: "relief" for button} -setup {
2009     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2010     pack .b
2011     update
2012 } -body {
2013     .b configure -relief flat
2014     .b cget -relief
2015 } -cleanup {
2016     destroy .b
2017 } -result {flat}
2018 test button-1.206 {configuration option: "relief" for button} -setup {
2019     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2020     pack .b
2021     update
2022 } -body {
2023     .b configure -relief 1.5
2024 } -cleanup {
2025     destroy .b
2026 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
2027 test button-1.207 {configuration option: "relief" for checkbutton} -setup {
2028     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2029     pack .c
2030     update
2031 } -body {
2032     .c configure -relief flat
2033     .c cget -relief
2034 } -cleanup {
2035     destroy .c
2036 } -result {flat}
2037 test button-1.208 {configuration option: "relief" for checkbutton} -setup {
2038     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2039     pack .c
2040     update
2041 } -body {
2042     .c configure -relief 1.5
2043 } -cleanup {
2044     destroy .c
2045 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
2046 test button-1.209 {configuration option: "relief" for radiobutton} -setup {
2047     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2048     pack .r
2049     update
2050 } -body {
2051     .r configure -relief flat
2052     .r cget -relief
2053 } -cleanup {
2054     destroy .r
2055 } -result {flat}
2056 test button-1.210 {configuration option: "relief" for radiobutton} -setup {
2057     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2058     pack .r
2059     update
2060 } -body {
2061     .r configure -relief 1.5
2062 } -cleanup {
2063     destroy .r
2064 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
2065
2066 test button-1.211 {configuration option: "selectcolor" for checkbutton} -setup {
2067     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2068     pack .c
2069     update
2070 } -body {
2071     .c configure -selectcolor #110022
2072     .c cget -selectcolor
2073 } -cleanup {
2074     destroy .c
2075 } -result {#110022}
2076 test button-1.212 {configuration option: "selectcolor" for checkbutton} -setup {
2077     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2078     pack .c
2079     update
2080 } -body {
2081     .c configure -selectcolor non-existent
2082 } -cleanup {
2083     destroy .c
2084 } -returnCodes {error} -result {unknown color name "non-existent"}
2085 test button-1.213 {configuration option: "selectcolor" for radiobutton} -setup {
2086     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2087     pack .r
2088     update
2089 } -body {
2090     .r configure -selectcolor #110022
2091     .r cget -selectcolor
2092 } -cleanup {
2093     destroy .r
2094 } -result {#110022}
2095 test button-1.214 {configuration option: "selectcolor" for radiobutton} -setup {
2096     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2097     pack .r
2098     update
2099 } -body {
2100     .r configure -selectcolor non-existent
2101 } -cleanup {
2102     destroy .r
2103 } -returnCodes {error} -result {unknown color name "non-existent"}
2104
2105 test button-1.215 {configuration option: "selectimage" for checkbutton} -constraints {
2106     testImageType
2107 } -setup {
2108     image create test image1
2109     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2110     pack .c
2111     update
2112 } -body {
2113     .c configure -selectimage image1
2114     .c cget -selectimage
2115 } -cleanup {
2116     destroy .c
2117     image delete image1
2118 } -result {image1}
2119 test button-1.216 {configuration option: "selectimage" for checkbutton} -setup {
2120     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2121     pack .c
2122     update
2123 } -body {
2124     .c configure -selectimage bogus
2125 } -cleanup {
2126     destroy .c
2127 } -returnCodes {error} -result {image "bogus" doesn't exist}
2128 test button-1.217 {configuration option: "selectimage" for radiobutton} -constraints {
2129     testImageType
2130 } -setup {
2131     image create test image1
2132     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2133     pack .r
2134     update
2135 } -body {
2136     .r configure -selectimage image1
2137     .r cget -selectimage
2138 } -cleanup {
2139     destroy .r
2140     image delete image1
2141 } -result {image1}
2142 test button-1.218 {configuration option: "selectimage" for radiobutton} -setup {
2143     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2144     pack .r
2145     update
2146 } -body {
2147     .r configure -selectimage bogus
2148 } -cleanup {
2149     destroy .r
2150 } -returnCodes {error} -result {image "bogus" doesn't exist}
2151
2152 test button-1.219 {configuration option: "state" for label} -setup {
2153     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2154     pack .l
2155     update
2156 } -body {
2157     .l configure -state normal
2158     .l cget -state
2159 } -cleanup {
2160     destroy .l
2161 } -result {normal}
2162 test button-1.220 {configuration option: "state" for label} -setup {
2163     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2164     pack .l
2165     update
2166 } -body {
2167     .l configure -state bogus
2168 } -cleanup {
2169     destroy .l
2170 } -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
2171 test button-1.221 {configuration option: "state" for button} -setup {
2172     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2173     pack .b
2174     update
2175 } -body {
2176     .b configure -state normal
2177     .b cget -state
2178 } -cleanup {
2179     destroy .b
2180 } -result {normal}
2181 test button-1.222 {configuration option: "state" for button} -setup {
2182     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2183     pack .b
2184     update
2185 } -body {
2186     .b configure -state bogus
2187 } -cleanup {
2188     destroy .b
2189 } -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
2190 test button-1.223 {configuration option: "state" for checkbutton} -setup {
2191     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2192     pack .c
2193     update
2194 } -body {
2195     .c configure -state normal
2196     .c cget -state
2197 } -cleanup {
2198     destroy .c
2199 } -result {normal}
2200 test button-1.224 {configuration option: "state" for checkbutton} -setup {
2201     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2202     pack .c
2203     update
2204 } -body {
2205     .c configure -state bogus
2206 } -cleanup {
2207     destroy .c
2208 } -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
2209 test button-1.225 {configuration option: "state" for radiobutton} -setup {
2210     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2211     pack .r
2212     update
2213 } -body {
2214     .r configure -state normal
2215     .r cget -state
2216 } -cleanup {
2217     destroy .r
2218 } -result {normal}
2219 test button-1.226 {configuration option: "state" for radiobutton} -setup {
2220     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2221     pack .r
2222     update
2223 } -body {
2224     .r configure -state bogus
2225 } -cleanup {
2226     destroy .r
2227 } -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
2228
2229 test button-1.227 {configuration option: "takefocus" for label} -setup {
2230     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2231     pack .l
2232     update
2233 } -body {
2234     .l configure -takefocus "any string"
2235     .l cget -takefocus
2236 } -cleanup {
2237     destroy .l
2238 } -result {any string}
2239 test button-1.228 {configuration option: "takefocus" for button} -setup {
2240     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2241     pack .b
2242     update
2243 } -body {
2244     .b configure -takefocus "any string"
2245     .b cget -takefocus
2246 } -cleanup {
2247     destroy .b
2248 } -result {any string}
2249 test button-1.229 {configuration option: "takefocus" for checkbutton} -setup {
2250     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2251     pack .c
2252     update
2253 } -body {
2254     .c configure -takefocus "any string"
2255     .c cget -takefocus
2256 } -cleanup {
2257     destroy .c
2258 } -result {any string}
2259 test button-1.230 {configuration option: "takefocus" for radiobutton} -setup {
2260     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2261     pack .r
2262     update
2263 } -body {
2264     .r configure -takefocus "any string"
2265     .r cget -takefocus
2266 } -cleanup {
2267     destroy .r
2268 } -result {any string}
2269
2270 test button-1.231 {configuration option: "text" for label} -setup {
2271     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2272     pack .l
2273     update
2274 } -body {
2275     .l configure -text "Sample text"
2276     .l cget -text
2277 } -cleanup {
2278     destroy .l
2279 } -result {Sample text}
2280 test button-1.232 {configuration option: "text" for button} -setup {
2281     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2282     pack .b
2283     update
2284 } -body {
2285     .b configure -text "Sample text"
2286     .b cget -text
2287 } -cleanup {
2288     destroy .b
2289 } -result {Sample text}
2290 test button-1.233 {configuration option: "text" for checkbutton} -setup {
2291     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2292     pack .c
2293     update
2294 } -body {
2295     .c configure -text "Sample text"
2296     .c cget -text
2297 } -cleanup {
2298     destroy .c
2299 } -result {Sample text}
2300 test button-1.234 {configuration option: "text" for radiobutton} -setup {
2301     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2302     pack .r
2303     update
2304 } -body {
2305     .r configure -text "Sample text"
2306     .r cget -text
2307 } -cleanup {
2308     destroy .r
2309 } -result {Sample text}
2310
2311 test button-1.235 {configuration option: "textvariable" for label} -setup {
2312     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2313     pack .l
2314     update
2315 } -body {
2316     .l configure -textvariable i
2317     .l cget -textvariable
2318 } -cleanup {
2319     destroy .l
2320 } -result {i}
2321 test button-1.236 {configuration option: "textvariable" for button} -setup {
2322     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2323     pack .b
2324     update
2325 } -body {
2326     .b configure -textvariable i
2327     .b cget -textvariable
2328 } -cleanup {
2329     destroy .b
2330 } -result {i}
2331 test button-1.237 {configuration option: "textvariable" for checkbutton} -setup {
2332     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2333     pack .c
2334     update
2335 } -body {
2336     .c configure -textvariable i
2337     .c cget -textvariable
2338 } -cleanup {
2339     destroy .c
2340 } -result {i}
2341 test button-1.238 {configuration option: "textvariable" for radiobutton} -setup {
2342     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2343     pack .r
2344     update
2345 } -body {
2346     .r configure -textvariable i
2347     .r cget -textvariable
2348 } -cleanup {
2349     destroy .r
2350 } -result {i}
2351
2352 test button-1.239 {configuration option: "tristateimage" for checkbutton} -constraints {
2353     testImageType
2354 } -setup {
2355     image create test image1
2356     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2357     pack .c
2358     update
2359 } -body {
2360     .c configure -tristateimage image1
2361     .c cget -tristateimage
2362 } -cleanup {
2363     destroy .c
2364     image delete image1
2365 } -result {image1}
2366 test button-1.240 {configuration option: "tristateimage" for checkbutton} -setup {
2367     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2368     pack .c
2369     update
2370 } -body {
2371     .c configure -tristateimage bogus
2372 } -cleanup {
2373     destroy .c
2374 } -returnCodes {error} -result {image "bogus" doesn't exist}
2375 test button-1.241 {configuration option: "tristateimage" for radiobutton} -constraints {
2376     testImageType
2377 } -setup {
2378     image create test image1
2379     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2380     pack .r
2381     update
2382 } -body {
2383     .r configure -tristateimage image1
2384     .r cget -tristateimage
2385 } -cleanup {
2386     destroy .r
2387     image delete image1
2388 } -result {image1}
2389 test button-1.242 {configuration option: "tristateimage" for radiobutton} -setup {
2390     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2391     pack .r
2392     update
2393 } -body {
2394     .r configure -tristateimage bogus
2395 } -cleanup {
2396     destroy .r
2397 } -returnCodes {error} -result {image "bogus" doesn't exist}
2398
2399 test button-1.243 {configuration option: "underline" for label} -setup {
2400     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2401     pack .l
2402     update
2403 } -body {
2404     .l configure -underline 5
2405     .l cget -underline
2406 } -cleanup {
2407     destroy .l
2408 } -result {5}
2409 test button-1.244 {configuration option: "underline" for label} -setup {
2410     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2411     pack .l
2412     update
2413 } -body {
2414     .l configure -underline 3p
2415 } -cleanup {
2416     destroy .l
2417 } -returnCodes {error} -result {expected integer but got "3p"}
2418 test button-1.245 {configuration option: "underline" for button} -setup {
2419     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2420     pack .b
2421     update
2422 } -body {
2423     .b configure -underline 5
2424     .b cget -underline
2425 } -cleanup {
2426     destroy .b
2427 } -result {5}
2428 test button-1.246 {configuration option: "underline" for button} -setup {
2429     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2430     pack .b
2431     update
2432 } -body {
2433     .b configure -underline 3p
2434 } -cleanup {
2435     destroy .b
2436 } -returnCodes {error} -result {expected integer but got "3p"}
2437 test button-1.247 {configuration option: "underline" for checkbutton} -setup {
2438     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2439     pack .c
2440     update
2441 } -body {
2442     .c configure -underline 5
2443     .c cget -underline
2444 } -cleanup {
2445     destroy .c
2446 } -result {5}
2447 test button-1.248 {configuration option: "underline" for checkbutton} -setup {
2448     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2449     pack .c
2450     update
2451 } -body {
2452     .c configure -underline 3p
2453 } -cleanup {
2454     destroy .c
2455 } -returnCodes {error} -result {expected integer but got "3p"}
2456 test button-1.249 {configuration option: "underline" for radiobutton} -setup {
2457     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2458     pack .r
2459     update
2460 } -body {
2461     .r configure -underline 5
2462     .r cget -underline
2463 } -cleanup {
2464     destroy .r
2465 } -result {5}
2466 test button-1.250 {configuration option: "underline" for radiobutton} -setup {
2467     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2468     pack .r
2469     update
2470 } -body {
2471     .r configure -underline 3p
2472 } -cleanup {
2473     destroy .r
2474 } -returnCodes {error} -result {expected integer but got "3p"}
2475
2476 test button-1.251 {configuration option: "tristatevalue" for checkbutton} -setup {
2477     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2478     pack .c
2479     update
2480 } -body {
2481     .c configure -tristatevalue unknowable
2482     .c cget -tristatevalue
2483 } -cleanup {
2484     destroy .c
2485 } -result {unknowable}
2486 test button-1.252 {configuration option: "tristatevalue" for radiobutton} -setup {
2487     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2488     pack .r
2489     update
2490 } -body {
2491     .r configure -tristatevalue unknowable
2492     .r cget -tristatevalue
2493 } -cleanup {
2494     destroy .r
2495 } -result {unknowable}
2496
2497 test button-1.253 {configuration option: "value" for radiobutton} -setup {
2498     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2499     pack .r
2500     update
2501 } -body {
2502     .r configure -value anyString
2503     .r cget -value
2504 } -cleanup {
2505     destroy .r
2506 } -result {anyString}
2507
2508 test button-1.254 {configuration option: "width" for label} -setup {
2509     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2510     pack .l
2511     update
2512 } -body {
2513     .l configure -width 402
2514     .l cget -width
2515 } -cleanup {
2516     destroy .l
2517 } -result {402}
2518 test button-1.255 {configuration option: "width" for label} -setup {
2519     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2520     pack .l
2521     update
2522 } -body {
2523     .l configure -width 3p
2524 } -cleanup {
2525     destroy .l
2526 } -returnCodes {error} -result {expected integer but got "3p"}
2527 test button-1.256 {configuration option: "width" for button} -setup {
2528     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2529     pack .b
2530     update
2531 } -body {
2532     .b configure -width 402
2533     .b cget -width
2534 } -cleanup {
2535     destroy .b
2536 } -result {402}
2537 test button-1.257 {configuration option: "width" for button} -setup {
2538     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2539     pack .b
2540     update
2541 } -body {
2542     .b configure -width 3p
2543 } -cleanup {
2544     destroy .b
2545 } -returnCodes {error} -result {expected integer but got "3p"}
2546 test button-1.258 {configuration option: "width" for checkbutton} -setup {
2547     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2548     pack .c
2549     update
2550 } -body {
2551     .c configure -width 402
2552     .c cget -width
2553 } -cleanup {
2554     destroy .c
2555 } -result {402}
2556 test button-1.259 {configuration option: "width" for checkbutton} -setup {
2557     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2558     pack .c
2559     update
2560 } -body {
2561     .c configure -width 3p
2562 } -cleanup {
2563     destroy .c
2564 } -returnCodes {error} -result {expected integer but got "3p"}
2565 test button-1.260 {configuration option: "width" for radiobutton} -setup {
2566     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2567     pack .r
2568     update
2569 } -body {
2570     .r configure -width 402
2571     .r cget -width
2572 } -cleanup {
2573     destroy .r
2574 } -result {402}
2575 test button-1.261 {configuration option: "width" for radiobutton} -setup {
2576     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2577     pack .r
2578     update
2579 } -body {
2580     .r configure -width 3p
2581 } -cleanup {
2582     destroy .r
2583 } -returnCodes {error} -result {expected integer but got "3p"}
2584
2585 test button-1.262 {configuration option: "wraplength" for label} -setup {
2586     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2587     pack .l
2588     update
2589 } -body {
2590     .l configure -wraplength 100
2591     .l cget -wraplength
2592 } -cleanup {
2593     destroy .l
2594 } -result {100}
2595 test button-1.263 {configuration option: "wraplength" for label} -setup {
2596     label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2597     pack .l
2598     update
2599 } -body {
2600     .l configure -wraplength 6x
2601 } -cleanup {
2602     destroy .l
2603 } -returnCodes {error} -result {bad screen distance "6x"}
2604 test button-1.264 {configuration option: "wraplength" for button} -setup {
2605     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2606     pack .b
2607     update
2608 } -body {
2609     .b configure -wraplength 100
2610     .b cget -wraplength
2611 } -cleanup {
2612     destroy .b
2613 } -result {100}
2614 test button-1.265 {configuration option: "wraplength" for button} -setup {
2615     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2616     pack .b
2617     update
2618 } -body {
2619     .b configure -wraplength 6x
2620 } -cleanup {
2621     destroy .b
2622 } -returnCodes {error} -result {bad screen distance "6x"}
2623 test button-1.266 {configuration option: "wraplength" for checkbutton} -setup {
2624     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2625     pack .c
2626     update
2627 } -body {
2628     .c configure -wraplength 100
2629     .c cget -wraplength
2630 } -cleanup {
2631     destroy .c
2632 } -result {100}
2633 test button-1.267 {configuration option: "wraplength" for checkbutton} -setup {
2634     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2635     pack .c
2636     update
2637 } -body {
2638     .c configure -wraplength 6x
2639 } -cleanup {
2640     destroy .c
2641 } -returnCodes {error} -result {bad screen distance "6x"}
2642 test button-1.268 {configuration option: "wraplength" for radiobutton} -setup {
2643     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2644     pack .r
2645     update
2646 } -body {
2647     .r configure -wraplength 100
2648     .r cget -wraplength
2649 } -cleanup {
2650     destroy .r
2651 } -result {100}
2652 test button-1.269 {configuration option: "wraplength" for radiobutton} -setup {
2653     radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2654     pack .r
2655     update
2656 } -body {
2657     .r configure -wraplength 6x
2658 } -cleanup {
2659     destroy .r
2660 } -returnCodes {error} -result {bad screen distance "6x"}
2661
2662 test button-1.270 {configuration options} -body {
2663 # Additional check to make sure that -selectcolor may be empty in
2664 # checkbox widgets
2665     checkbutton .c
2666     .c configure -selectcolor {}
2667 } -cleanup {
2668     destroy .c
2669 } -result {}
2670
2671 # ex-tests 3.*
2672 test button-2.1 {ButtonCreate - not enough arguments} -body {
2673     button
2674 } -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"}
2675
2676 test button-2.2 {ButtonCreate procedure - setting label class} -body {
2677     label .x
2678     winfo class .x
2679 } -cleanup {
2680     destroy .x
2681 } -result {Label}
2682 test button-2.3 {ButtonCreate - setting button class} -body {
2683     button .x
2684     winfo class .x
2685 } -cleanup {
2686     destroy .x
2687 } -result {Button}
2688 test button-2.4 {ButtonCreate - setting checkbutton class} -body {
2689     checkbutton .x
2690     winfo class .x
2691 } -cleanup {
2692     destroy .x
2693 } -result {Checkbutton}
2694 test button-2.5 {ButtonCreate - setting radiobutton class} -body {
2695     radiobutton .x
2696     winfo class .x
2697 } -cleanup {
2698     destroy .x
2699 } -result {Radiobutton}
2700 test button-2.6 {ButtonCreate - setting class} -body {
2701     rename button gorp
2702     gorp .x
2703     winfo class .x
2704 } -cleanup {
2705     destroy .x
2706     rename gorp button
2707 } -result {Button}
2708
2709 test button-2.7 {ButtonCreate - bad window name} -body {
2710     button foo
2711 } -cleanup {
2712     destroy foo
2713 } -returnCodes {error} -result {bad window path name "foo"}
2714 ######### test ex 3.8
2715 test button-2.8 {ButtonCreate procedure - error in default option value} -body {
2716     option add *funny.background bogus
2717     button .funny
2718 } -cleanup {
2719     option clear
2720     destroy .funny
2721 } -returnCodes {error} -result {unknown color name "bogus"}
2722 test button-2.9 {ButtonCreate procedure - error in default option value} -body {
2723    option add *funny.background bogus
2724     catch {button .funny}
2725     return $errorInfo
2726 } -cleanup {
2727     option clear
2728     destroy .funny
2729 } -result {unknown color name "bogus"
2730     (database entry for "-background" in widget ".funny")
2731     invoked from within
2732 "button .funny"}
2733
2734 test button-2.10 {ButtonCreate procedure - option error} -body {
2735     button .x -gorp foo
2736 }  -cleanup {
2737     destroy .x
2738 } -returnCodes {error} -result {unknown option "-gorp"}
2739 test button-2.11 {ButtonCreate procedure - option error} -body {
2740     catch {button .x -gorp foo}
2741     winfo exists .x
2742 }  -cleanup {
2743     destroy .x
2744 } -result 0
2745 ######### ex 3.10
2746 test button-2.12 {ButtonCreate procedure - return value} -body {
2747     set x [button .abcd]
2748     return $x
2749 } -cleanup {
2750     destroy .abcd
2751 } -result {.abcd}
2752
2753 ######### ex 4.*
2754 test button-3.1 {ButtonWidgetCmd - too few arguments} -body {
2755     button .b
2756     .b
2757 } -cleanup {
2758     destroy .b
2759 } -returnCodes {error} -result {wrong # args: should be ".b option ?arg ...?"}
2760 test button-3.2 {ButtonWidgetCmd - bad option name} -body {
2761     button .b
2762     .b c
2763 } -cleanup {
2764     destroy .b
2765 } -returnCodes {error} -result {ambiguous option "c": must be cget, configure, flash, or invoke}
2766 test button-3.3 {ButtonWidgetCmd - bad option name} -body {
2767     button .b
2768     .b bogus
2769 } -cleanup {
2770     destroy .b
2771 } -returnCodes {error} -result {bad option "bogus": must be cget, configure, flash, or invoke}
2772 test button-3.4 {ButtonWidgetCmd procedure, "cget" option} -body {
2773     button .b
2774     .b cget a b
2775 } -cleanup {
2776     destroy .b
2777 } -returnCodes {error} -result {wrong # args: should be ".b cget option"}
2778 test button-3.5 {ButtonWidgetCmd procedure, "cget" option} -body {
2779     button .b
2780     .b cget -gorp
2781 } -cleanup {
2782     destroy .b
2783 } -returnCodes {error} -result {unknown option "-gorp"}
2784
2785 #ex 4.7
2786 test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body {
2787     label .l
2788     .l cget -disabledforeground
2789 } -cleanup {
2790     destroy .l
2791 } -returnCodes {ok} -match {glob} -result {*}
2792 test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body {
2793     button .b
2794     .b cget -disabledforeground
2795 } -cleanup {
2796     destroy .b
2797 } -returnCodes {ok} -match {glob} -result {*}
2798 test button-3.8 {ButtonWidgetCmd procedure, "cget" option} -body {
2799     button .b
2800     .b cget -variable
2801 } -cleanup {
2802     destroy .b
2803 } -returnCodes {error} -result {unknown option "-variable"}
2804
2805 test button-3.9 {ButtonWidgetCmd procedure, "cget" option} -body {
2806     checkbutton .c
2807     .c cget -variable
2808 } -cleanup {
2809     destroy .c
2810 } -returnCodes {ok} -match {glob} -result {*}
2811 test button-3.10 {ButtonWidgetCmd procedure, "cget" option} -body {
2812     checkbutton .c
2813     .c cget -value
2814 } -cleanup {
2815     destroy .c
2816 } -returnCodes {error} -result {unknown option "-value"}
2817
2818 test button-3.11 {ButtonWidgetCmd procedure, "cget" option} -body {
2819     radiobutton .r
2820     .r cget -value
2821 } -cleanup {
2822     destroy .r
2823 } -returnCodes {ok} -match {glob} -result {*}
2824 test button-3.12 {ButtonWidgetCmd procedure, "cget" option} -body {
2825     radiobutton .r
2826     .r cget -onvalue
2827 } -cleanup {
2828     destroy .r
2829 } -returnCodes {error} -result {unknown option "-onvalue"}
2830
2831 # ex 4.6
2832 test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body {
2833     button .b -highlightthickness 3
2834     lindex [.b configure -highlightthickness] 4
2835 } -cleanup {
2836     destroy .b
2837 }  -result {3}
2838 test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -body {
2839     checkbutton .c
2840     llength [.c configure]
2841 } -cleanup {
2842     destroy .c
2843 } -result {41}
2844 test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body {
2845     button .b
2846     .b configure -gorp
2847 } -cleanup {
2848     destroy .b
2849 } -returnCodes {error} -result {unknown option "-gorp"}
2850 test button-3.16 {ButtonWidgetCmd procedure, "configure" option} -setup {
2851     button .b
2852 } -body {
2853     .b co -bg #ffffff -fg
2854 } -cleanup {
2855     destroy .b
2856 } -returnCodes {error} -result {value for "-fg" missing}
2857 test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup {
2858     button .b
2859 } -body {
2860     .b configure -fg #123456
2861     .b configure -bg #654321
2862     lindex [.b configure -fg] 4
2863 } -cleanup {
2864     destroy .b
2865 } -result {#123456}
2866 test button-3.18 {ButtonWidgetCmd procedure, "deselect" option} -body {
2867     checkbutton .c
2868     .c deselect foo
2869 } -cleanup {
2870     destroy .c
2871 } -returnCodes {error} -result {wrong # args: should be ".c deselect"}
2872 test button-3.19 {ButtonWidgetCmd procedure, "deselect" option} -body {
2873     label .l
2874     .l deselect
2875 } -cleanup {
2876     destroy .l
2877 } -returnCodes {error} -result {bad option "deselect": must be cget or configure}
2878 test button-3.20 {ButtonWidgetCmd procedure, "deselect" option} -body {
2879     button .b
2880     .b deselect
2881 } -cleanup {
2882     destroy .b
2883 } -returnCodes {error} -result {bad option "deselect": must be cget, configure, flash, or invoke}
2884
2885 test button-3.21 {ButtonWidgetCmd procedure, "deselect" option} -body {
2886     checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
2887     set checkvar 1
2888     .c d
2889     return $checkvar
2890 } -cleanup {
2891     destroy .c
2892 } -result {0}
2893 test button-3.22 {ButtonWidgetCmd procedure, "deselect" option} -body {
2894     radiobutton .r -variable radiovar -value red
2895     set radiovar green
2896     .r deselect
2897     return $radiovar
2898 } -cleanup {
2899     destroy .r
2900 } -result {green}
2901 test button-3.23 {ButtonWidgetCmd procedure, "deselect" option} -body {
2902     radiobutton .r -variable radiovar -value red
2903     set radiovar red
2904     .r deselect
2905     return $radiovar
2906 } -cleanup {
2907     destroy .r
2908 } -result {}
2909
2910 test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body {
2911     checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
2912     set checkvar 1
2913     trace variable checkvar w bogusTrace
2914     .c deselect
2915 } -cleanup {
2916     destroy .c
2917     trace vdelete checkvar w bogusTrace
2918 } -returnCodes {error} -result {can't set "checkvar": trace aborted}
2919 test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body {
2920     checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
2921     set checkvar 1
2922     trace variable checkvar w bogusTrace
2923     catch {.c deselect}
2924     list $errorInfo $checkvar
2925 } -cleanup {
2926     trace vdelete checkvar w bogusTrace
2927     destroy .c
2928 } -match {glob} -result {{*trace aborted
2929     while executing
2930 *
2931 ".c deselect"} 0}
2932 test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body {
2933     radiobutton .r -variable radiovar -value red
2934     set radiovar red
2935     trace variable radiovar w bogusTrace
2936     .r deselect
2937 } -cleanup {
2938     destroy .r
2939     trace vdelete radiovar w bogusTrace
2940 } -match {glob} -returnCodes {error} -result {can't set "radiovar": trace aborted}
2941 test button-3.27 {ButtonWidgetCmd procedure, "deselect" option} -body {
2942     radiobutton .r -variable radiovar -value red
2943     set radiovar red
2944     trace variable radiovar w bogusTrace
2945     catch {.r deselect}
2946     list $errorInfo $radiovar
2947 } -cleanup {
2948     destroy .r
2949     trace vdelete radiovar w bogusTrace
2950 } -match glob -result {{*trace aborted
2951     while executing
2952 *
2953 ".r deselect"} {}}
2954
2955 test button-3.28 {ButtonWidgetCmd procedure, "flash" option} -body {
2956     button .b
2957     .b flash foo
2958 } -cleanup {
2959     destroy .b
2960 } -returnCodes {error} -result {wrong # args: should be ".b flash"}
2961 test button-3.29 {ButtonWidgetCmd procedure, "flash" option} -body {
2962     label .l
2963     .l flash
2964 } -cleanup {
2965     destroy .l
2966 } -returnCodes {error} -result {bad option "flash": must be cget or configure}
2967 test button-3.30 {ButtonWidgetCmd procedure, "flash" option} -body {
2968     button .b
2969     catch {.b flash}
2970 } -cleanup {
2971     destroy .b
2972 } -returnCodes {ok} -match {glob} -result {*}
2973 test button-3.31 {ButtonWidgetCmd procedure, "flash" option} -body {
2974     checkbutton .c
2975     catch {.c flash}
2976 } -cleanup {
2977     destroy .c
2978 } -returnCodes {ok} -match {glob} -result {*}
2979 test button-3.32 {ButtonWidgetCmd procedure, "flash" option} -body {
2980     radiobutton .r
2981     catch {.r f}
2982 } -cleanup {
2983     destroy .r
2984 } -returnCodes {ok} -match {glob} -result {*}
2985
2986 test button-3.33 {ButtonWidgetCmd procedure, "invoke" option} -body {
2987     label .l
2988     .l invoke
2989 } -cleanup {
2990     destroy .l
2991 } -returnCodes {error} -result {bad option "invoke": must be cget or configure}
2992 test button-3.34 {ButtonWidgetCmd procedure, "invoke" option} -body {
2993     button .b
2994     .b invoke foo
2995 } -cleanup {
2996     destroy .b
2997 } -returnCodes {error} -result {wrong # args: should be ".b invoke"}
2998 test button-3.35 {ButtonWidgetCmd procedure, "invoke" option} -body {
2999     button .b
3000     .b configure -command {set x invoked}
3001     set x "not invoked"
3002     .b invoke
3003     return $x
3004 } -cleanup {
3005     destroy .b
3006 } -result {invoked}
3007 test button-3.36 {ButtonWidgetCmd procedure, "invoke" option} -body {
3008     button .b
3009     .b configure -command {set x invoked} -state disabled
3010     set x "not invoked"
3011     .b invoke
3012     return $x
3013 } -cleanup {
3014     destroy .b
3015 } -result {not invoked}
3016 test button-3.37 {ButtonWidgetCmd procedure, "invoke" option} -body {
3017     checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 \
3018         -command {set x invoked}
3019     set checkvar bogus
3020     set x "not invoked"
3021     .c invoke
3022     list $x $checkvar
3023 } -cleanup {
3024     destroy .c
3025 } -result  {invoked 1}
3026 test button-3.38 {ButtonWidgetCmd procedure, "invoke" option} -body {
3027     radiobutton .r -command {set x invoked} -variable radiovar -value red
3028     set radiovar green
3029     set x "not invoked"
3030     .r i
3031     list $x $radiovar
3032 } -cleanup {
3033     destroy .r
3034 } -result {invoked red}
3035
3036 test button-3.39 {ButtonWidgetCmd procedure, "select" option} -body {
3037     label .l
3038     .l select
3039 } -cleanup {
3040     destroy .l
3041 } -returnCodes {error} -result {bad option "select": must be cget or configure}
3042 test button-3.40 {ButtonWidgetCmd procedure, "select" option} -body {
3043     button .b
3044     .b select
3045 } -cleanup {
3046     destroy .b
3047 } -returnCodes {error} -result {bad option "select": must be cget, configure, flash, or invoke}
3048 test button-3.41 {ButtonWidgetCmd procedure, "select" option} -body {
3049     checkbutton .c
3050     .c select foo
3051 } -cleanup {
3052     destroy .c
3053 } -returnCodes {error} -result {wrong # args: should be ".c select"}
3054 test button-3.42 {ButtonWidgetCmd procedure, "select" option} -body {
3055     checkbutton .c -variable checkvar -onvalue lovely -offvalue 0
3056     set checkvar bogus
3057     .c s
3058     return $checkvar
3059 } -cleanup {
3060     destroy .c
3061 } -result  {lovely}
3062 test button-3.43 {ButtonWidgetCmd procedure, "select" option} -body {
3063     radiobutton .r -variable radiovar -value red
3064     set radiovar green
3065     .r select
3066     return $radiovar
3067 } -cleanup {
3068     destroy .r
3069 } -result  {red}
3070 test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body {
3071     radiobutton .r -variable radiovar -value red
3072     set radiovar yellow
3073     trace variable radiovar w bogusTrace
3074     .r select
3075 } -cleanup {
3076     destroy .r
3077     trace vdelete radiovar w bogusTrace
3078 } -returnCodes {error} -result {can't set "radiovar": trace aborted}
3079 test button-3.45 {ButtonWidgetCmd procedure, "select" option} -body {
3080     radiobutton .r -variable radiovar -value red
3081     set radiovar yellow
3082     trace variable radiovar w bogusTrace
3083     catch {.r select}
3084     list $errorInfo $radiovar
3085 } -cleanup {
3086     destroy .r
3087     trace vdelete radiovar w bogusTrace
3088 } -match {glob} -result {{*trace aborted
3089     while executing
3090 *
3091 ".r select"} red}
3092
3093 # ex 4.43
3094 test button-3.46 {ButtonWidgetCmd procedure, "toggle" option} -body {
3095     label .l
3096     .l toggle
3097 } -cleanup {
3098     destroy .l
3099 } -returnCodes {error} -result {bad option "toggle": must be cget or configure}
3100 test button-3.47 {ButtonWidgetCmd procedure, "toggle" option} -body {
3101     button .b
3102     .b toggle
3103 } -cleanup {
3104     destroy .b
3105 } -returnCodes {error} -result {bad option "toggle": must be cget, configure, flash, or invoke}
3106 test button-3.48 {ButtonWidgetCmd procedure, "toggle" option} -body {
3107     radiobutton .r
3108     .r toggle
3109 } -cleanup {
3110     destroy .r
3111 } -returnCodes {error} -result {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select}
3112 test button-3.49 {ButtonWidgetCmd procedure, "toggle" option} -body {
3113     checkbutton .c
3114     .c toggle foo
3115 } -cleanup {
3116     destroy .c
3117 } -returnCodes {error} -result {wrong # args: should be ".c toggle"}
3118 test button-3.50 {ButtonWidgetCmd procedure, "toggle" option} -body {
3119     set checkvar bogus
3120     checkbutton .c -variable checkvar -onvalue sunshine -offvalue rain
3121     .c toggle
3122     set result $checkvar
3123     .c toggle
3124     lappend result $checkvar
3125     .c toggle
3126     lappend result $checkvar
3127     return $result
3128 } -cleanup {
3129     destroy .c
3130 } -result {sunshine rain sunshine}
3131 test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body {
3132     checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3133     set checkvar xyz
3134     trace variable checkvar w bogusTrace
3135     .c toggle
3136 } -cleanup {
3137     destroy .c
3138     trace vdelete checkvar w bogusTrace
3139 } -returnCodes {error} -result {can't set "checkvar": trace aborted}
3140 test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body {
3141     checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3142     set checkvar xyz
3143     trace variable checkvar w bogusTrace
3144     catch {.c toggle}
3145     list $errorInfo $checkvar
3146 } -cleanup {
3147     trace vdelete checkvar w bogusTrace
3148     destroy .c
3149 } -match {glob} -result {{*trace aborted
3150     while executing
3151 *
3152 ".c toggle"} abc}
3153 test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body {
3154     checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3155     set checkvar abc
3156     trace variable checkvar w bogusTrace
3157     .c toggle
3158 } -cleanup {
3159     trace vdelete checkvar w bogusTrace
3160     destroy .c
3161 } -returnCodes {error} -result {can't set "checkvar": trace aborted}
3162 test button-3.54 {ButtonWidgetCmd procedure, "toggle" option} -body {
3163     checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3164     set checkvar abc
3165     trace variable checkvar w bogusTrace
3166     catch {.c toggle}
3167     list $errorInfo $checkvar
3168 } -cleanup {
3169     trace vdelete checkvar w bogusTrace
3170     destroy .c
3171 } -match {glob} -result {{*trace aborted
3172     while executing
3173 *
3174 ".c toggle"} xyz}
3175 test button-3.55 {ButtonWidgetCmd procedure, "toggle" option} -setup {
3176     unset -nocomplain checkvar
3177 } -body {
3178     checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3179     unset checkvar
3180     set checkvar(1) 1
3181     .c toggle
3182 } -cleanup {
3183     destroy .c
3184 } -returnCodes {error} -result {can't set "checkvar": variable is array}
3185 test button-3.56 {ButtonWidgetCmd procedure, "toggle" option} -setup {
3186     unset -nocomplain checkvar
3187 } -body {
3188     checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3189     unset checkvar
3190     set checkvar(1) 1
3191     catch {.c toggle}
3192     return $errorInfo
3193 } -cleanup {
3194     destroy .c
3195 } -match {glob} -result {can't set "checkvar": variable is array
3196     while executing
3197 ".c toggle"}
3198
3199 test button-4.1 {DestroyButton procedure} -constraints {
3200     testImageType
3201 } -setup {
3202     image create test image1
3203     unset -nocomplain x
3204 } -body {
3205     button .b1 -image image1
3206     button .b2 -fg #ff0000 -text "Button 2"
3207     button .b3 -state active -text "Button 3"
3208     button .b4 -disabledforeground #0000ff -state disabled -text "Button 4"
3209     checkbutton .b5 -variable x -text "Checkbutton 5"
3210     set x 1
3211     pack .b1 .b2 .b3 .b4 .b5
3212     update
3213     deleteWindows
3214 } -cleanup {
3215     destroy .b1 .b2 .b3 .b4 .b5
3216     image delete image1
3217 } -result {}
3218
3219 test button-5.1 {ConfigureButton - textvariable trace} -body {
3220     button .b -bd 4 -bg green
3221     .b configure -bd 7 -bg red -fg bogus
3222 } -cleanup {
3223     destroy .b
3224 } -returnCodes {error} -result {unknown color name "bogus"}
3225 test button-5.2 {ConfigureButton - textvariable trace} -body {
3226     button .b -bd 4 -bg green
3227     catch {.b configure -bd 7 -bg red -fg bogus}
3228     list [.b cget -bd] [.b cget -bg]
3229 } -cleanup {
3230     destroy .b
3231 } -result {4 green}
3232 test button-5.3 {ConfigureButton - textvariable trace} -body {
3233     button .b -textvariable x
3234     set x From-x
3235     set y From-y
3236     .b configure -textvariable y
3237     set x New
3238     lindex [.b configure -text] 4
3239 } -cleanup {
3240     destroy .b
3241 } -result {From-y}
3242 test button-5.4 {ConfigureButton - variable trace} -body {  ;# ex 6.2a
3243     checkbutton .c -variable x
3244     set x 1
3245     set y 1
3246     .c configure -textvariable y
3247     set x 0
3248     .c toggle
3249     return $y
3250 } -cleanup {
3251     destroy .c
3252 } -result {1}
3253
3254 test button-5.5 {ConfigureButton - image handling} -constraints {
3255     testImageType
3256 } -setup {
3257     imageCleanup
3258     image create test image1
3259     image create test image2
3260 } -body {
3261     button .b -image image1
3262     image delete image1
3263     .b configure -image image2
3264     imageNames
3265 } -cleanup {
3266     destroy .b
3267     imageCleanup
3268 } -result {image2}
3269
3270 test button-5.6 {ConfigureButton - default value for variable} -body {
3271     checkbutton .c
3272     .c cget -variable
3273 } -cleanup {
3274     destroy .c
3275 } -result {c}
3276 test button-5.7 {ConfigureButton - setting selected state from variable} -body {
3277     set x 0
3278     set y Shiny
3279     checkbutton .c -variable x
3280     .c configure -variable y -onvalue Shiny
3281     .c toggle
3282     return $y
3283 } -cleanup {
3284     destroy .c
3285 } -result {0}
3286 test button-5.8 {ConfigureButton - setting selected state from variable} -setup {
3287     unset -nocomplain x
3288 } -body {
3289     checkbutton .c -variable x -offvalue Bogus
3290     return $x
3291 } -cleanup {
3292     destroy .c
3293 } -result {Bogus}
3294
3295 test button-5.9 {ConfigureButton - setting selected state from variable} -setup {
3296     unset -nocomplain x
3297 } -body {
3298     radiobutton .r -variable x
3299     return $x
3300 } -cleanup {
3301     destroy .r
3302 } -result {}
3303
3304 test button-5.10 {ConfigureButton - error in setting variable} -setup {
3305     unset -nocomplain x
3306 } -body {
3307     trace variable x w bogusTrace
3308     radiobutton .r -variable x
3309 } -cleanup {
3310     destroy .r
3311     trace vdelete x w bogusTrace
3312 } -returnCodes {error} -result {can't set "x": trace aborted}
3313
3314 test button-5.11 {ConfigureButton - bad image name} -body {
3315     button .b -image bogus
3316 } -cleanup {
3317     destroy .b
3318 } -returnCodes {error} -result {image "bogus" doesn't exist}
3319
3320 test button-5.12 {ConfigureButton - setting variable from current text value} -setup {
3321     unset -nocomplain x
3322 } -body {
3323     button .b -textvariable x -text "Button 1"
3324     return $x
3325 } -cleanup {
3326     destroy .b
3327 } -result {Button 1}
3328
3329 test button-5.13 {ConfigureButton - using current value of variable} -body {
3330     set x Override
3331     button .b -textvariable x -text "Button 1"
3332     return $x
3333 } -cleanup {
3334     destroy .b
3335 } -result {Override}
3336
3337 test button-5.14 {ConfigureButton - variable handling} -setup {
3338     unset -nocomplain x
3339 } -body {
3340     trace variable x w bogusTrace
3341     radiobutton .r -text foo -textvariable x
3342 } -cleanup {
3343     trace vdelete x w bogusTrace
3344     destroy .r
3345 } -returnCodes {error} -result {can't set "x": trace aborted}
3346 test button-5.15 {ConfigureButton - variable handling} -setup {
3347     unset -nocomplain x
3348 } -body {
3349     trace variable x w bogusTrace
3350     catch {radiobutton .r -text foo -textvariable x}
3351         return $x
3352 } -cleanup {
3353     trace vdelete x w bogusTrace
3354     destroy .r
3355 } -result {foo}
3356
3357 #ex 6.14
3358 test button-5.16 {ConfigureButton - -width option} -body {
3359     button .b -text "Button 1"
3360     .b configure -width 1i
3361 } -cleanup {
3362     destroy .b
3363 } -returnCodes {error} -result {expected integer but got "1i"}
3364 test button-5.17 {ConfigureButton - -width option} -body {
3365     button .b -text "Button 1"
3366     catch {.b configure -width 1i}
3367     return $errorInfo
3368 } -cleanup {
3369     destroy .b
3370 } -result  {expected integer but got "1i"
3371     (processing -width option)
3372     invoked from within
3373 ".b configure -width 1i"}
3374 test button-5.18 {ConfigureButton - -height option} -body {
3375     button .b -text "Button 1"
3376     .b configure -height 0.5c
3377 } -cleanup {
3378     destroy .b
3379 } -returnCodes {error} -result {expected integer but got "0.5c"}
3380 test button-5.19 {ConfigureButton - -height option} -body {
3381     button .b -text "Button 1"
3382     catch {.b configure -height 0.5c}
3383     return $errorInfo
3384 } -cleanup {
3385     destroy .b
3386 } -result {expected integer but got "0.5c"
3387     (processing -height option)
3388     invoked from within
3389 ".b configure -height 0.5c"}
3390 #ex 6.16
3391 test button-5.20 {ConfigureButton - -width option} -body {
3392     button .b -bitmap questhead
3393     .b configure -width abc
3394 } -cleanup {
3395     destroy .b
3396 } -returnCodes {error} -result  {bad screen distance "abc"}
3397 test button-5.21 {ConfigureButton - -width option} -body {
3398     button .b -bitmap questhead
3399     catch {.b configure -width abc}
3400     return $errorInfo
3401 } -cleanup {
3402     destroy .b
3403 } -result {bad screen distance "abc"
3404     (processing -width option)
3405     invoked from within
3406 ".b configure -width abc"}
3407 test button-5.22 {ConfigureButton - -height option} -constraints {
3408     testImageType
3409 } -setup {
3410     image create test image1
3411 } -body {
3412     button .b -image image1
3413     .b configure -height 0.5x
3414 } -cleanup {
3415     destroy .b
3416     image delete image1
3417 } -returnCodes {error} -result {bad screen distance "0.5x"}
3418 test button-5.23 {ConfigureButton - -height option} -constraints {
3419     testImageType
3420 } -setup {
3421     image create test image1
3422 } -body {
3423 #ztestImageType
3424     button .b -image image1
3425     catch {.b configure -height 0.5x}
3426     return $errorInfo
3427 } -cleanup {
3428     destroy .b
3429     image delete image1
3430 } -result  {bad screen distance "0.5x"
3431     (processing -height option)
3432     invoked from within
3433 ".b configure -height 0.5x"}
3434 #ex 6.18
3435 test button-5.24 {ConfigureButton - computing geometry} -constraints {
3436     fonts
3437 } -body {
3438     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
3439                 -padx 30 -pady 20
3440     # 1. button with text
3441     .b configure -text "Sample text"
3442     pack .b
3443     set textwidth [font measure [.b cget -font] -displayof .b [.b cget -text]]
3444     set expectedwidth [expr {$textwidth + 2*[.b cget -borderwidth] \
3445             + 2*[.b cget -highlightthickness] + 2*[.b cget -padx]}]
3446     incr expectedwidth 2   ; # added (hardcoded) in tkUnixButton.c
3447     set result [expr {$expectedwidth == [winfo reqwidth .b]}]
3448     set linespace [lindex [font metrics [.b cget -font] -displayof .b] 5]
3449     set expectedheight [expr {$linespace + 2*[.b cget -borderwidth] \
3450             + 2*[.b cget -highlightthickness] + 2*[.b cget -pady]}]
3451     incr expectedheight 2   ; # added (hardcoded) in tkUnixButton.c
3452     lappend result [expr {$expectedheight == [winfo reqheight .b]}]
3453     # 2. button with a bitmap image
3454     # there is no access to characteristics the predefined bitmaps,
3455     # so define one as an image (copied from questhead.xbm)
3456     set myquesthead [image create bitmap -data {
3457         #define myquesthead_width 20
3458         #define myquesthead_height 22
3459         static unsigned char myquesthead_bits[] = {
3460            0xf8, 0x1f, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00, 0xeb, 0xaf, 0x00,
3461            0xf5, 0x5f, 0x01, 0xfb, 0xbf, 0x00, 0x75, 0x5d, 0x01, 0xfb, 0xbe, 0x02,
3462            0x75, 0x5d, 0x05, 0xab, 0xbe, 0x0a, 0x55, 0x5f, 0x07, 0xab, 0xaf, 0x00,
3463            0xd6, 0x57, 0x01, 0xac, 0xab, 0x00, 0xd8, 0x57, 0x00, 0xb0, 0xaa, 0x00,
3464            0x50, 0x55, 0x00, 0xb0, 0x0b, 0x00, 0xd0, 0x17, 0x00, 0xb0, 0x0b, 0x00,
3465            0x58, 0x15, 0x00, 0xa8, 0x2a, 0x00};
3466     }]
3467     .b configure -image $myquesthead
3468     set expectedwidth [expr {[image width $myquesthead] + 2*[.b cget -borderwidth] \
3469             + 2*[.b cget -highlightthickness]}]
3470     incr expectedwidth 2   ; # added (hardcoded) in tkUnixButton.c
3471     lappend result [expr {$expectedwidth == [winfo reqwidth .b]}]
3472     set expectedheight [expr {[image height $myquesthead] + 2*[.b cget -borderwidth] \
3473             + 2*[.b cget -highlightthickness]}]
3474     incr expectedheight 2   ; # added (hardcoded) in tkUnixButton.c
3475     lappend result [expr {$expectedheight == [winfo reqheight .b]}]
3476 } -cleanup {
3477     destroy .b
3478 } -result {1 1 1 1}
3479
3480 test button-5.25 {ConfigureButton - computing geometry} -setup {
3481     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3482 } -body {
3483     .b configure -text "Button 1"
3484     set old [winfo reqwidth .b]
3485     .b configure -text "Much longer text"
3486     set new [winfo reqwidth .b]
3487     expr {$old == $new}
3488 } -cleanup {
3489     destroy .b
3490 } -result {0}
3491
3492 test button-6.1 {ButtonEventProc procedure} -body {
3493     button .b -text "Test Button" -command {
3494            destroy .b
3495            set x [list [winfo exists .b] [info commands .b]]
3496 }
3497     .b invoke
3498     return $x
3499 } -cleanup {
3500     destroy .b
3501 } -result {0 {}}
3502
3503 test button-6.2 {ButtonEventProc procedure} -setup {
3504     set x {}
3505 } -body {
3506     button .b1 -bg #543210
3507     rename .b1 .b2
3508     lappend x [winfo children .]
3509     lappend x [.b2 cget -bg]
3510     destroy .b1
3511     lappend x [info command .b*] [winfo children .]
3512 } -cleanup {
3513     destroy .b1
3514 } -result {.b1 #543210 {} {}}
3515
3516 test button-7.1 {ButtonCmdDeletedProc procedure} -body {
3517     button .b
3518     rename .b {}
3519     list [info command .b*] [winfo children .]
3520 } -cleanup {
3521     destroy .b
3522 } -result {{} {}}
3523
3524 test button-8.1 {TkInvokeButton procedure} -setup {
3525     set x 0
3526 } -body {
3527     checkbutton .c -variable x
3528     set result $x
3529     .c invoke
3530     lappend result $x
3531     .c invoke
3532     lappend result $x
3533 } -cleanup {
3534     destroy .c
3535 } -result {0 1 0}
3536
3537 test button-8.2 {TkInvokeButton procedure} -setup {
3538     set x 0
3539 } -body {
3540     checkbutton .c -variable x
3541     trace variable x w bogusTrace
3542     .c invoke
3543 } -cleanup {
3544     destroy .c
3545     trace vdelete x w bogusTrace
3546 } -returnCodes {error} -result {can't set "x": trace aborted}
3547 test button-8.3 {TkInvokeButton procedure} -setup {
3548     set x 0
3549 } -body {
3550     checkbutton .c -variable x
3551     trace variable x w bogusTrace
3552     catch {.c invoke}
3553     return $x
3554 } -cleanup {
3555     destroy .c
3556     trace vdelete x w bogusTrace
3557 } -result {1}
3558 test button-8.4 {TkInvokeButton procedure} -setup {
3559     set x 1
3560 } -body {
3561     checkbutton .c -variable x
3562     trace variable x w bogusTrace
3563     .c invoke
3564 } -cleanup {
3565     destroy .c
3566     trace vdelete x w bogusTrace
3567 } -returnCodes {error} -result {can't set "x": trace aborted}
3568 test button-8.5 {TkInvokeButton procedure} -setup {
3569     set x 1
3570 } -body {
3571     checkbutton .c -variable x
3572     trace variable x w bogusTrace
3573     catch {.c invoke}
3574     return $x
3575 } -cleanup {
3576     destroy .c
3577     trace vdelete x w bogusTrace
3578 } -result {0}
3579
3580 test button-8.6 {TkInvokeButton procedure} -setup {
3581     set x 0
3582 } -body {
3583     radiobutton .r -variable x -value red
3584     set result $x
3585     .r invoke
3586     lappend result $x
3587     .r invoke
3588     lappend result $x
3589 } -cleanup {
3590     destroy .r
3591 } -result {0 red red}
3592
3593 test button-8.7 {TkInvokeButton procedure} -body {
3594     radiobutton .r -variable x -value red
3595     set x green
3596     trace variable x w bogusTrace
3597     .r invoke
3598 } -cleanup {
3599     destroy .r
3600     trace vdelete x w bogusTrace
3601 } -returnCodes {error} -result {can't set "x": trace aborted}
3602 test button-8.8 {TkInvokeButton procedure} -body {
3603     radiobutton .r -variable x -value red
3604     set x green
3605     trace variable x w bogusTrace
3606     catch {.r invoke}
3607     list $errorInfo $x
3608 } -cleanup {
3609     destroy .r
3610     trace vdelete x w bogusTrace
3611 } -match {glob} -result {{*trace aborted
3612     while executing
3613 *
3614 ".r invoke"} red}
3615
3616 #ex 9.6
3617 test button-8.9 {TkInvokeButton procedure} -setup {
3618     set result untouched
3619 } -body {
3620     button .b -command {set result invoked}
3621     set msg [.b invoke]
3622     list $msg $result
3623 } -cleanup {
3624     destroy .b
3625 } -result {invoked invoked}
3626 test button-8.10 {TkInvokeButton procedure} -setup {
3627     set result untouched
3628     set x 0
3629 } -body {
3630     checkbutton .c -variable x -command {set result "invoked $x"}
3631     set msg [.c invoke]
3632     list $msg $result
3633 } -cleanup {
3634     destroy .c
3635 } -result {{invoked 1} {invoked 1}}
3636 test button-8.11 {TkInvokeButton procedure} -setup {
3637     set result untouched
3638     set x 0
3639 } -body {
3640     radiobutton .r -variable x -value red -command {set result "invoked $x"}
3641     set msg [.r invoke]
3642     list $msg $result
3643 } -cleanup {
3644     destroy .r
3645 } -result {{invoked red} {invoked red}}
3646
3647 test button-9.1 {ButtonVarProc procedure} -body {
3648     set x 1
3649     checkbutton .c -variable x
3650     unset x
3651     set result [info exists x]
3652     .c toggle
3653     lappend result $x
3654     set x 0
3655     .c toggle
3656     lappend result $x
3657 } -cleanup {
3658     destroy .c
3659 } -result {0 1 1}
3660 test button-9.2 {ButtonVarProc procedure} -body {
3661     set x 0
3662     checkbutton .c -variable x
3663     set x 44
3664     .c toggle
3665     return $x
3666 } -cleanup {
3667     destroy .c
3668 } -result {1}
3669 test button-9.3 {ButtonVarProc procedure} -setup {
3670     set x 1
3671 } -body {
3672     checkbutton .c -variable x
3673     set x 44
3674     .c toggle
3675     return $x
3676 } -cleanup {
3677     destroy .c
3678 } -result {1}
3679 test button-9.4 {ButtonVarProc procedure} -setup {
3680     set x 0
3681 } -body {
3682     checkbutton .c -variable x
3683     set x 1
3684     .c toggle
3685     return $x
3686 } -cleanup {
3687     destroy .c
3688 } -result {0}
3689 test button-9.5 {ButtonVarProc procedure} -setup {
3690     set x 1
3691 } -body {
3692     checkbutton .c -variable x
3693     set x 1
3694     .c toggle
3695     return $x
3696 } -cleanup {
3697     destroy .c
3698 } -result {0}
3699 test button-9.6 {ButtonVarProc procedure} -setup {
3700     set x 0
3701 } -body {
3702     checkbutton .c -variable x
3703     set x 0
3704     .c toggle
3705     return $x
3706 } -cleanup {
3707     destroy .c
3708 } -result {1}
3709 test button-9.7 {ButtonVarProc procedure} -setup {
3710     set x 1
3711 } -body {
3712     checkbutton .c -variable x
3713     set x 0
3714     .c toggle
3715     return $x
3716 } -cleanup {
3717     destroy .c
3718 } -result {1}
3719 test button-9.8 {ButtonVarProc procedure, can't read variable} -setup {
3720 # This test does nothing but produce a core dump if there's a prbblem.
3721     unset -nocomplain a
3722 } -body {
3723     checkbutton .c -variable a
3724     unset a
3725     set a(32) 0
3726     unset a
3727 } -cleanup {
3728     destroy .c
3729 } -result {}
3730
3731 test button-10.1 {ButtonTextVarProc procedure} -body {
3732     set x Label
3733     button .b -textvariable x
3734     unset x
3735     set result [list $x [.b cget -text]]
3736     set x New
3737     lappend result [.b cget -text]
3738 } -cleanup {
3739     destroy .b
3740 } -result {Label Label New}
3741 test button-10.2 {ButtonTextVarProc procedure} -setup {
3742     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3743 } -body {
3744 # Windows buttons have a default min width, so we have to
3745 # set this to be longer to force the wider button.
3746     set x ExtraLongLabel
3747     .b configure -textvariable x
3748     set old [winfo reqwidth .b]
3749     set x New
3750     set new [winfo reqwidth .b]
3751     expr {$old == $new}
3752 } -cleanup {
3753     destroy .b
3754 } -result {0}
3755
3756 test button-11.1 {ButtonImageProc procedure} -constraints {
3757     testImageType
3758 } -setup {
3759     label .l -highlightthickness 0 -font {Helvetica -12 bold}
3760     image create test image1
3761 } -body {
3762     .l configure -image image1 -padx 0 -pady 0 -bd 0
3763     pack .l
3764     set result "[winfo reqwidth .l] [winfo reqheight .l]"
3765     image1 changed 0 0 0 0 80 100
3766     lappend result [winfo reqwidth .l] [winfo reqheight .l]
3767 } -cleanup {
3768     destroy .l
3769     image delete image1
3770 } -result {30 15 80 100}
3771
3772 test button-12.1 {button widget vs hidden commands} -body {
3773     button .b -text hello
3774     set l [interp hidden]
3775     interp hide {} .b
3776     destroy .b
3777
3778     set res1 [list [winfo children .] [interp hidden]]
3779     set res2 [list {} $l]
3780     expr {$res1 == $res2}
3781 } -cleanup {
3782     destroy .b
3783 } -result {1}
3784
3785 test button-13.1 {size behavior: label} -setup {
3786     label .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3787     label .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3788     label .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3789     set result {}
3790 } -body {
3791         .a configure -text Hej
3792         .b configure -text Hej -width 10 -height 1
3793         .c configure -text "" -width 10 -height 1
3794
3795 # With -width, width should not be affected by text change
3796         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3797 # With -height, height should not be affected by text change
3798         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3799 # A one line text should be as high as -height 1
3800         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3801 } -cleanup {
3802     destroy .a .b .c
3803 } -result {1 1 1}
3804 test button-13.2 {size behavior: label} -setup {
3805     label .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3806     label .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3807     label .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3808     set result {}
3809 } -body {
3810         .a configure -text Hej
3811         .b configure -text Hej -width 10 -height 1
3812         .c configure -text "" -width 10 -height 1
3813
3814 # With -width, width should not be affected by text change
3815         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3816 # With -height, height should not be affected by text change
3817         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3818 # A one line text should be as high as -height 1
3819         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3820 } -cleanup {
3821     destroy .a .b .c
3822 } -result {1 1 1}
3823
3824 test button-13.3 {size behavior: button} -setup {
3825     button .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3826     button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3827     button .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3828     set result {}
3829 } -body {
3830         .a configure -text Hej
3831         .b configure -text Hej -width 10 -height 1
3832         .c configure -text "" -width 10 -height 1
3833
3834 # With -width, width should not be affected by text change
3835         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3836 # With -height, height should not be affected by text change
3837         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3838 # A one line text should be as high as -height 1
3839         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3840 } -cleanup {
3841     destroy .a .b .c
3842 } -result {1 1 1}
3843 test button-13.4 {size behavior: button} -setup {
3844     button .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3845     button .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3846     button .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3847     set result {}
3848 } -body {
3849         .a configure -text Hej
3850         .b configure -text Hej -width 10 -height 1
3851         .c configure -text "" -width 10 -height 1
3852
3853 # With -width, width should not be affected by text change
3854         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3855 # With -height, height should not be affected by text change
3856         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3857 # A one line text should be as high as -height 1
3858         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3859 } -cleanup {
3860     destroy .a .b .c
3861 } -result {1 1 1}
3862
3863 test button-13.5 {size behavior: radiobutton} -setup {
3864     radiobutton .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3865     radiobutton .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3866     radiobutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3867     set result {}
3868 } -body {
3869         .a configure -text Hej
3870         .b configure -text Hej -width 10 -height 1
3871         .c configure -text "" -width 10 -height 1
3872
3873 # With -width, width should not be affected by text change
3874         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3875 # With -height, height should not be affected by text change
3876         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3877 # A one line text should be as high as -height 1
3878         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3879 } -cleanup {
3880     destroy .a .b .c
3881 } -result {1 1 1}
3882
3883 test button-13.6 {size behavior: radiobutton} -setup {
3884     radiobutton .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3885     radiobutton .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3886     radiobutton .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3887     set result {}
3888 } -body {
3889         .a configure -text Hej
3890         .b configure -text Hej -width 10 -height 1
3891         .c configure -text "" -width 10 -height 1
3892
3893 # With -width, width should not be affected by text change
3894         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3895 # With -height, height should not be affected by text change
3896         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3897 # A one line text should be as high as -height 1
3898         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3899 } -cleanup {
3900     destroy .a .b .c
3901 } -result {1 1 1}
3902
3903 test button-13.7 {size behavior: checkbutton} -setup {
3904     checkbutton .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3905     checkbutton .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3906     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
3907     set result {}
3908 } -body {
3909         .a configure -text Hej
3910         .b configure -text Hej -width 10 -height 1
3911         .c configure -text "" -width 10 -height 1
3912
3913 # With -width, width should not be affected by text change
3914         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3915 # With -height, height should not be affected by text change
3916         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3917 # A one line text should be as high as -height 1
3918         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3919 } -cleanup {
3920     destroy .a .b .c
3921 } -result {1 1 1}
3922
3923 test button-13.8 {size behavior: checkbutton} -setup {
3924     checkbutton .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3925     checkbutton .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3926     checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
3927     set result {}
3928 } -body {
3929         .a configure -text Hej
3930         .b configure -text Hej -width 10 -height 1
3931         .c configure -text "" -width 10 -height 1
3932
3933 # With -width, width should not be affected by text change
3934         lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
3935 # With -height, height should not be affected by text change
3936         lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
3937 # A one line text should be as high as -height 1
3938         lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
3939 } -cleanup {
3940     destroy .a .b .c
3941 } -result {1 1 1}
3942
3943 test button-14.1 {bug fix: [011706ec42] tk::ButtonInvoke unsafe wrt widget destruction} -body {
3944     proc destroy_button {} {
3945         if {[winfo exists .top.b]} {
3946             destroy .top.b
3947         }
3948     }
3949     toplevel .top
3950     button .top.b -text Foo -command destroy_button
3951     bind .top.b <space> destroy_button
3952     pack .top.b
3953     focus -force .top.b
3954     update
3955     event generate .top.b <space>
3956     update  ; # shall not trigger error  invalid command name ".top.b"
3957 } -cleanup {
3958     destroy .top.b .top
3959 } -result {}
3960
3961 test button-15.1 {Bug [5d991b822e]} {
3962     # Want this not to segfault
3963     set var INIT
3964     button .b -textvariable var
3965     trace add variable var unset {apply {args {
3966         .b configure -textvariable {}
3967     }}}
3968     pack .b
3969     bind .b <Configure> {unset var}
3970     update
3971     destroy .b
3972 } {}
3973 test button-15.2 {Bug [5d991b822e]} {
3974     # Want this not to leak traces
3975     set var INIT
3976     button .b -textvariable var
3977     trace add variable var unset {apply {args {
3978         .b configure -textvariable new
3979     }}}
3980     pack .b
3981     bind .b <Configure> {unset -nocomplain var}
3982     update
3983     destroy .b
3984     unset new
3985 } {}
3986 test button-15.3 {Bug [5d991b822e]} {
3987     # Want this not to leak traces
3988     set var INIT
3989     checkbutton .b -variable var
3990     trace add variable var unset {apply {args {
3991         .b configure -variable {}
3992     }}}
3993     pack .b
3994     bind .b <Configure> {unset var}
3995     update
3996     destroy .b
3997 } {}
3998
3999
4000 imageFinish
4001 cleanupTests
4002 return
4003
4004 # Local variables:
4005 # mode: tcl
4006 # End: