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.
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.
10 package require tcltest 2.2
11 namespace import ::tcltest::*
12 eval tcltest::configure $argv
13 tcltest::loadTestedCommands
16 proc bogusTrace args {
20 test button-1.1 {configuration option: "activebackground" for label} -setup {
21 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
25 .l configure -activebackground #012345
26 .l cget -activebackground
30 test button-1.2 {configuration option: "activebackground" for label} -setup {
31 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
35 .l configure -activebackground non-existent
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}
44 .b configure -activebackground #012345
45 .b cget -activebackground
49 test button-1.4 {configuration option: "activebackground" for button} -setup {
50 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
54 .b configure -activebackground non-existent
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}
63 .c configure -activebackground #012345
64 .c cget -activebackground
68 test button-1.6 {configuration option: "activebackground" for checkbutton} -setup {
69 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
73 .c configure -activebackground non-existent
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}
82 .r configure -activebackground #012345
83 .r cget -activebackground
87 test button-1.8 {configuration option: "activebackground" for radiobutton} -setup {
88 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
92 .r configure -activebackground non-existent
95 } -returnCodes {error} -result {unknown color name "non-existent"}
97 test button-1.9 {configuration option: "activeforeground" for label} -setup {
98 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
102 .l configure -activeforeground #ff0000
103 .l cget -activeforeground
107 test button-1.10 {configuration option: "activeforeground" for label} -setup {
108 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
112 .l configure -activeforeground non-existent
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}
121 .b configure -activeforeground #ff0000
122 .b cget -activeforeground
126 test button-1.12 {configuration option: "activeforeground" for button} -setup {
127 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
131 .b configure -activeforeground non-existent
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}
140 .c configure -activeforeground #ff0000
141 .c cget -activeforeground
145 test button-1.14 {configuration option: "activeforeground" for checkbutton} -setup {
146 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
150 .c configure -activeforeground non-existent
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}
159 .r configure -activeforeground #ff0000
160 .r cget -activeforeground
164 test button-1.16 {configuration option: "activeforeground" for radiobutton} -setup {
165 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
169 .r configure -activeforeground non-existent
172 } -returnCodes {error} -result {unknown color name "non-existent"}
174 test button-1.17 {configuration option: "anchor" for label} -setup {
175 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
179 .l configure -anchor nw
184 test button-1.18 {configuration option: "anchor" for label} -setup {
185 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
189 .l configure -anchor bogus
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}
198 .b configure -anchor nw
203 test button-1.20 {configuration option: "anchor" for button} -setup {
204 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
208 .b configure -anchor bogus
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}
217 .c configure -anchor nw
222 test button-1.22 {configuration option: "anchor" for checkbutton} -setup {
223 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
227 .c configure -anchor bogus
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}
236 .r configure -anchor nw
241 test button-1.24 {configuration option: "anchor" for radiobutton} -setup {
242 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
246 .r configure -anchor bogus
249 } -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
251 test button-1.25 {configuration option: "background" for label} -setup {
252 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
256 .l configure -background #ff0000
261 test button-1.26 {configuration option: "background" for label} -setup {
262 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
266 .l configure -background non-existent
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}
275 .b configure -background #ff0000
280 test button-1.28 {configuration option: "background" for button} -setup {
281 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
285 .b configure -background non-existent
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}
294 .c configure -background #ff0000
299 test button-1.30 {configuration option: "background" for checkbutton} -setup {
300 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
304 .c configure -background non-existent
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}
313 .r configure -background #ff0000
318 test button-1.32 {configuration option: "background" for radiobutton} -setup {
319 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
323 .r configure -background non-existent
326 } -returnCodes {error} -result {unknown color name "non-existent"}
328 test button-1.33 {configuration option: "bd" for label} -setup {
329 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
338 test button-1.34 {configuration option: "bd" for label} -setup {
339 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
343 .l configure -bd badValue
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}
357 test button-1.36 {configuration option: "bd" for button} -setup {
358 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
362 .b configure -bd badValue
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}
376 test button-1.38 {configuration option: "bd" for checkbutton} -setup {
377 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
381 .c configure -bd badValue
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}
395 test button-1.40 {configuration option: "bd" for radiobutton} -setup {
396 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
400 .r configure -bd badValue
403 } -returnCodes {error} -result {bad screen distance "badValue"}
405 test button-1.41 {configuration option: "bg" for label} -setup {
406 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
410 .l configure -bg #ff0000
415 test button-1.42 {configuration option: "bg" for label} -setup {
416 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
420 .l configure -bg non-existent
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}
429 .b configure -bg #ff0000
434 test button-1.44 {configuration option: "bg" for button} -setup {
435 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
439 .b configure -bg non-existent
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}
448 .c configure -bg #ff0000
453 test button-1.46 {configuration option: "bg" for checkbutton} -setup {
454 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
458 .c configure -bg non-existent
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}
467 .r configure -bg #ff0000
472 test button-1.48 {configuration option: "bg" for radiobutton} -setup {
473 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
477 .r configure -bg non-existent
480 } -returnCodes {error} -result {unknown color name "non-existent"}
482 test button-1.49 {configuration option: "bitmap" for label} -setup {
483 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
487 .l configure -bitmap questhead
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}
497 .l configure -bitmap badValue
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}
506 .b configure -bitmap questhead
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}
516 .b configure -bitmap badValue
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}
525 .c configure -bitmap questhead
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}
535 .c configure -bitmap badValue
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}
544 .r configure -bitmap questhead
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}
554 .r configure -bitmap badValue
557 } -returnCodes {error} -result {bitmap "badValue" not defined}
559 test button-1.57 {configuration option: "borderwidth" for label} -setup {
560 label .l -highlightthickness 2 -font {Helvetica -12 bold}
564 .l configure -borderwidth 1.3
569 test button-1.58 {configuration option: "borderwidth" for label} -setup {
570 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
574 .l configure -borderwidth badValue
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}
583 .b configure -borderwidth 1.3
588 test button-1.60 {configuration option: "borderwidth" for button} -setup {
589 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
593 .b configure -borderwidth badValue
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}
602 .c configure -borderwidth 1.3
607 test button-1.62 {configuration option: "borderwidth" for checkbutton} -setup {
608 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
612 .c configure -borderwidth badValue
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}
621 .r configure -borderwidth 1.3
626 test button-1.64 {configuration option: "borderwidth" for radiobutton} -setup {
627 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
631 .r configure -borderwidth badValue
634 } -returnCodes {error} -result {bad screen distance "badValue"}
636 test button-1.65 {configuration option: "command" for button} -setup {
637 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
641 .b configure -command {set x}
646 test button-1.66 {configuration option: "command" for button} -setup {
647 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
651 .b configure -command {set x}
656 test button-1.67 {configuration option: "command" for checkbutton} -setup {
657 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
661 .c configure -command {set x}
666 test button-1.68 {configuration option: "command" for radiobutton} -setup {
667 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
671 .r configure -command {set x}
677 test button-1.69 {configuration option: "compound" for label} -setup {
678 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
682 .l configure -compound left
687 test button-1.70 {configuration option: "compound" for label} -setup {
688 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
692 .l configure -compound bogus
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}
701 .b configure -compound left
706 test button-1.72 {configuration option: "compound" for button} -setup {
707 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
711 .b configure -compound bogus
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}
720 .c configure -compound left
725 test button-1.74 {configuration option: "compound" for checkbutton} -setup {
726 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
730 .c configure -compound bogus
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}
739 .r configure -compound left
744 test button-1.76 {configuration option: "compound" for radiobutton} -setup {
745 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
749 .r configure -compound bogus
752 } -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
754 test button-1.77 {configuration option: "cursor" for label} -setup {
755 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
759 .l configure -cursor arrow
764 test button-1.78 {configuration option: "cursor" for label} -setup {
765 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
769 .l configure -cursor badValue
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}
778 .b configure -cursor arrow
783 test button-1.80 {configuration option: "cursor" for button} -setup {
784 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
788 .b configure -cursor badValue
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}
797 .c configure -cursor arrow
802 test button-1.82 {configuration option: "cursor" for checkbutton} -setup {
803 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
807 .c configure -cursor badValue
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}
816 .r configure -cursor arrow
821 test button-1.84 {configuration option: "cursor" for radiobutton} -setup {
822 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
826 .r configure -cursor badValue
829 } -returnCodes {error} -result {bad cursor spec "badValue"}
831 test button-1.85 {configuration option: "default" for button} -setup {
832 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
836 .b configure -default active
841 test button-1.86 {configuration option: "default" for button} -setup {
842 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
846 .b configure -default huh?
849 } -returnCodes {error} -result {bad default "huh?": must be active, disabled, or normal}
851 test button-1.87 {configuration option: "disabledforeground" for label} -setup {
852 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
856 .l configure -disabledforeground #00ff00
857 .l cget -disabledforeground
861 test button-1.88 {configuration option: "disabledforeground" for label} -setup {
862 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
866 .l configure -disabledforeground non-existent
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}
875 .b configure -disabledforeground #00ff00
876 .b cget -disabledforeground
880 test button-1.90 {configuration option: "disabledforeground" for button} -setup {
881 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
885 .b configure -disabledforeground non-existent
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}
894 .c configure -disabledforeground #00ff00
895 .c cget -disabledforeground
899 test button-1.92 {configuration option: "disabledforeground" for checkbutton} -setup {
900 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
904 .c configure -disabledforeground non-existent
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}
913 .r configure -disabledforeground #00ff00
914 .r cget -disabledforeground
918 test button-1.94 {configuration option: "disabledforeground" for radiobutton} -setup {
919 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
923 .r configure -disabledforeground non-existent
926 } -returnCodes {error} -result {unknown color name "non-existent"}
928 test button-1.95 {configuration option: "fg" for label} -setup {
929 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
933 .l configure -fg #110022
938 test button-1.96 {configuration option: "fg" for label} -setup {
939 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
943 .l configure -fg non-existent
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}
952 .b configure -fg #110022
957 test button-1.98 {configuration option: "fg" for button} -setup {
958 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
962 .b configure -fg non-existent
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}
971 .c configure -fg #110022
976 test button-1.100 {configuration option: "fg" for checkbutton} -setup {
977 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
981 .c configure -fg non-existent
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}
990 .r configure -fg #110022
995 test button-1.102 {configuration option: "fg" for radiobutton} -setup {
996 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1000 .r configure -fg non-existent
1003 } -returnCodes {error} -result {unknown color name "non-existent"}
1005 test button-1.103 {configuration option: "font" for label} -setup {
1006 label .l -borderwidth 2 -highlightthickness 2
1010 .l configure -font {Helvetica -12}
1014 } -result {Helvetica -12}
1015 test button-1.104 {configuration option: "activebackground" for label} -setup {
1016 label .l -borderwidth 2 -highlightthickness 2
1020 .l configure -font {}
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
1029 .b configure -font {Helvetica -12}
1033 } -result {Helvetica -12}
1034 test button-1.106 {configuration option: "activebackground" for button} -setup {
1035 button .b -borderwidth 2 -highlightthickness 2
1039 .b configure -font {}
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
1048 .c configure -font {Helvetica -12}
1052 } -result {Helvetica -12}
1053 test button-1.108 {configuration option: "activebackground" for checkbutton} -setup {
1054 checkbutton .c -borderwidth 2 -highlightthickness 2
1058 .c configure -font {}
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
1067 .r configure -font {Helvetica -12}
1071 } -result {Helvetica -12}
1072 test button-1.110 {configuration option: "activebackground" for radiobutton} -setup {
1073 radiobutton .r -borderwidth 2 -highlightthickness 2
1077 .r configure -font {}
1080 } -returnCodes {error} -result {font "" doesn't exist}
1082 test button-1.111 {configuration option: "foreground" for label} -setup {
1083 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1087 .l configure -foreground #110022
1092 test button-1.112 {configuration option: "foreground" for label} -setup {
1093 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1097 .l configure -foreground non-existent
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}
1106 .b configure -foreground #110022
1111 test button-1.114 {configuration option: "foreground" for button} -setup {
1112 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1116 .b configure -foreground non-existent
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}
1125 .c configure -foreground #110022
1130 test button-1.116 {configuration option: "foreground" for checkbutton} -setup {
1131 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1135 .c configure -foreground non-existent
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}
1144 .r configure -foreground #110022
1149 test button-1.118 {configuration option: "foreground" for radiobutton} -setup {
1150 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1154 .r configure -foreground non-existent
1157 } -returnCodes {error} -result {unknown color name "non-existent"}
1159 test button-1.119 {configuration option: "height" for label} -setup {
1160 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1164 .l configure -height 18
1169 test button-1.120 {configuration option: "height" for label} -setup {
1170 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1174 .l configure -height 20.0
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}
1183 .b configure -height 18
1188 test button-1.122 {configuration option: "height" for button} -setup {
1189 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1193 .b configure -height 20.0
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}
1202 .c configure -height 18
1207 test button-1.124 {configuration option: "height" for checkbutton} -setup {
1208 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1212 .c configure -height 20.0
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}
1221 .r configure -height 18
1226 test button-1.126 {configuration option: "height" for radiobutton} -setup {
1227 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1231 .r configure -height 20.0
1234 } -returnCodes {error} -result {expected integer but got "20.0"}
1236 test button-1.127 {configuration option: "highlightbackground" for label} -setup {
1237 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1241 .l configure -highlightbackground #110022
1242 .l cget -highlightbackground
1246 test button-1.128 {configuration option: "highlightbackground" for label} -setup {
1247 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1251 .l configure -highlightbackground non-existent
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}
1260 .b configure -highlightbackground #110022
1261 .b cget -highlightbackground
1265 test button-1.130 {configuration option: "highlightbackground" for button} -setup {
1266 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1270 .b configure -highlightbackground non-existent
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}
1279 .c configure -highlightbackground #110022
1280 .c cget -highlightbackground
1284 test button-1.132 {configuration option: "highlightbackground" for checkbutton} -setup {
1285 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1289 .c configure -highlightbackground non-existent
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}
1298 .r configure -highlightbackground #110022
1299 .r cget -highlightbackground
1303 test button-1.134 {configuration option: "highlightbackground" for radiobutton} -setup {
1304 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1308 .r configure -highlightbackground non-existent
1311 } -returnCodes {error} -result {unknown color name "non-existent"}
1313 test button-1.135 {configuration option: "highlightcolor" for label} -setup {
1314 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1318 .l configure -highlightcolor #110022
1319 .l cget -highlightcolor
1323 test button-1.136 {configuration option: "highlightcolor" for label} -setup {
1324 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1328 .l configure -highlightcolor non-existent
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}
1337 .b configure -highlightcolor #110022
1338 .b cget -highlightcolor
1342 test button-1.138 {configuration option: "highlightcolor" for button} -setup {
1343 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1347 .b configure -highlightcolor non-existent
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}
1356 .c configure -highlightcolor #110022
1357 .c cget -highlightcolor
1361 test button-1.140 {configuration option: "highlightcolor" for checkbutton} -setup {
1362 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1366 .c configure -highlightcolor non-existent
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}
1375 .r configure -highlightcolor #110022
1376 .r cget -highlightcolor
1380 test button-1.142 {configuration option: "highlightcolor" for radiobutton} -setup {
1381 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1385 .r configure -highlightcolor non-existent
1388 } -returnCodes {error} -result {unknown color name "non-existent"}
1390 test button-1.143 {configuration option: "highlightthickness" for label} -setup {
1391 label .l -borderwidth 2 -font {Helvetica -12 bold}
1395 .l configure -highlightthickness 6m
1396 .l cget -highlightthickness
1400 test button-1.144 {configuration option: "highlightthickness" for label} -setup {
1401 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1405 .l configure -highlightthickness badValue
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}
1414 .b configure -highlightthickness 6m
1415 .b cget -highlightthickness
1419 test button-1.146 {configuration option: "highlightthickness" for button} -setup {
1420 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1424 .b configure -highlightthickness badValue
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}
1433 .c configure -highlightthickness 6m
1434 .c cget -highlightthickness
1438 test button-1.148 {configuration option: "highlightthickness" for checkbutton} -setup {
1439 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1443 .c configure -highlightthickness badValue
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}
1452 .r configure -highlightthickness 6m
1453 .r cget -highlightthickness
1457 test button-1.150 {configuration option: "highlightthickness" for radiobutton} -setup {
1458 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1462 .r configure -highlightthickness badValue
1465 } -returnCodes {error} -result {bad screen distance "badValue"}
1467 test button-1.151 {configuration option: "image" for label} -constraints {
1470 image create test image1
1471 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1475 .l configure -image image1
1481 test button-1.152 {configuration option: "image" for label} -setup {
1482 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1486 .l configure -image bogus
1489 } -returnCodes {error} -result {image "bogus" doesn't exist}
1490 test button-1.153 {configuration option: "image" for button} -constraints {
1493 image create test image1
1494 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1498 .b configure -image image1
1504 test button-1.154 {configuration option: "image" for button} -setup {
1505 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1509 .b configure -image bogus
1512 } -returnCodes {error} -result {image "bogus" doesn't exist}
1513 test button-1.155 {configuration option: "image" for checkbutton} -constraints {
1516 image create test image1
1517 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1521 .c configure -image image1
1527 test button-1.156 {configuration option: "image" for checkbutton} -setup {
1528 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1532 .c configure -image bogus
1535 } -returnCodes {error} -result {image "bogus" doesn't exist}
1536 test button-1.157 {configuration option: "image" for radiobutton} -constraints {
1539 image create test image1
1540 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1544 .r configure -image image1
1550 test button-1.158 {configuration option: "image" for radiobutton} -setup {
1551 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1555 .r configure -image bogus
1558 } -returnCodes {error} -result {image "bogus" doesn't exist}
1560 test button-1.159 {configuration option: "indicatoron" for checkbutton} -setup {
1561 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1565 .c configure -indicatoron yes
1566 .c cget -indicatoron
1570 test button-1.160 {configuration option: "indicatoron" for checkbutton} -setup {
1571 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1575 .c configure -indicatoron no_way
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}
1584 .r configure -indicatoron yes
1585 .r cget -indicatoron
1589 test button-1.162 {configuration option: "indicatoron" for radiobutton} -setup {
1590 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1594 .r configure -indicatoron no_way
1597 } -returnCodes {error} -result {expected boolean value but got "no_way"}
1599 test button-1.163 {configuration option: "justify" for label} -setup {
1600 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1604 .l configure -justify right
1609 test button-1.164 {configuration option: "justify" for label} -setup {
1610 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1614 .l configure -justify bogus
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}
1623 .b configure -justify right
1628 test button-1.166 {configuration option: "justify" for button} -setup {
1629 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1633 .b configure -justify bogus
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}
1642 .c configure -justify right
1647 test button-1.168 {configuration option: "justify" for checkbutton} -setup {
1648 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1652 .c configure -justify bogus
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}
1661 .r configure -justify right
1666 test button-1.170 {configuration option: "justify" for radiobutton} -setup {
1667 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1671 .r configure -justify bogus
1674 } -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
1676 test button-1.171 {configuration option: "offrelief" for checkbutton} -setup {
1677 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1681 .c configure -offrelief flat
1686 test button-1.172 {configuration option: "offrelief" for checkbutton} -setup {
1687 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1691 .c configure -offrelief 1.5
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}
1700 .r configure -offrelief flat
1705 test button-1.174 {configuration option: "offrelief" for radiobutton} -setup {
1706 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1710 .r configure -offrelief 1.5
1713 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1715 test button-1.175 {configuration option: "offvalue" for checkbutton} -setup {
1716 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1720 .c configure -offvalue lousy
1726 test button-1.176 {configuration option: "onvalue" for checkbutton} -setup {
1727 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1731 .c configure -onvalue fantastic
1735 } -result {fantastic}
1737 test button-1.177 {configuration option: "overrelief" for button} -setup {
1738 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1742 .b configure -overrelief ""
1747 test button-1.178 {configuration option: "overrelief" for button} -setup {
1748 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1752 .b configure -overrelief 1.5
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}
1761 .c configure -overrelief ""
1766 test button-1.180 {configuration option: "overrelief" for checkbutton} -setup {
1767 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1771 .c configure -overrelief 1.5
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}
1780 .r configure -overrelief ""
1785 test button-1.182 {configuration option: "overrelief" for radiobutton} -setup {
1786 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1790 .r configure -overrelief 1.5
1793 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
1795 test button-1.183 {configuration option: "padx" for label} -setup {
1796 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1800 .l configure -padx 12m
1805 test button-1.184 {configuration option: "padx" for label} -setup {
1806 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1810 .l configure -padx 420x
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}
1819 .b configure -padx 12m
1824 test button-1.186 {configuration option: "padx" for button} -setup {
1825 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1829 .b configure -padx 420x
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}
1838 .c configure -padx 12m
1843 test button-1.188 {configuration option: "padx" for checkbutton} -setup {
1844 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1848 .c configure -padx 420x
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}
1857 .r configure -padx 12m
1862 test button-1.190 {configuration option: "padx" for radiobutton} -setup {
1863 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1867 .r configure -padx 420x
1870 } -returnCodes {error} -result {bad screen distance "420x"}
1872 test button-1.191 {configuration option: "pady" for label} -setup {
1873 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1877 .l configure -pady 12m
1882 test button-1.192 {configuration option: "pady" for label} -setup {
1883 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1887 .l configure -pady 420x
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}
1896 .b configure -pady 12m
1901 test button-1.194 {configuration option: "pady" for button} -setup {
1902 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1906 .b configure -pady 420x
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}
1915 .c configure -pady 12m
1920 test button-1.196 {configuration option: "pady" for checkbutton} -setup {
1921 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1925 .c configure -pady 420x
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}
1934 .r configure -pady 12m
1939 test button-1.198 {configuration option: "pady" for radiobutton} -setup {
1940 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1944 .r configure -pady 420x
1947 } -returnCodes {error} -result {bad screen distance "420x"}
1949 test button-1.199 {configuration option: "repeatdelay" for button} -setup {
1950 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1954 .b configure -repeatdelay 100
1955 .b cget -repeatdelay
1959 test button-1.200 {configuration option: "repeatdelay" for button} -setup {
1960 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1964 .b configure -repeatdelay foo
1967 } -returnCodes {error} -result {expected integer but got "foo"}
1969 test button-1.201 {configuration option: "repeatinterval" for button} -setup {
1970 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1974 .b configure -repeatinterval 100
1975 .b cget -repeatinterval
1979 test button-1.202 {configuration option: "repeatinterval" for button} -setup {
1980 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1984 .b configure -repeatinterval foo
1987 } -returnCodes {error} -result {expected integer but got "foo"}
1989 test button-1.203 {configuration option: "relief" for label} -setup {
1990 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
1994 .l configure -relief flat
1999 test button-1.204 {configuration option: "relief" for label} -setup {
2000 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2004 .l configure -relief 1.5
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}
2013 .b configure -relief flat
2018 test button-1.206 {configuration option: "relief" for button} -setup {
2019 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2023 .b configure -relief 1.5
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}
2032 .c configure -relief flat
2037 test button-1.208 {configuration option: "relief" for checkbutton} -setup {
2038 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2042 .c configure -relief 1.5
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}
2051 .r configure -relief flat
2056 test button-1.210 {configuration option: "relief" for radiobutton} -setup {
2057 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2061 .r configure -relief 1.5
2064 } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
2066 test button-1.211 {configuration option: "selectcolor" for checkbutton} -setup {
2067 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2071 .c configure -selectcolor #110022
2072 .c cget -selectcolor
2076 test button-1.212 {configuration option: "selectcolor" for checkbutton} -setup {
2077 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2081 .c configure -selectcolor non-existent
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}
2090 .r configure -selectcolor #110022
2091 .r cget -selectcolor
2095 test button-1.214 {configuration option: "selectcolor" for radiobutton} -setup {
2096 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2100 .r configure -selectcolor non-existent
2103 } -returnCodes {error} -result {unknown color name "non-existent"}
2105 test button-1.215 {configuration option: "selectimage" for checkbutton} -constraints {
2108 image create test image1
2109 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2113 .c configure -selectimage image1
2114 .c cget -selectimage
2119 test button-1.216 {configuration option: "selectimage" for checkbutton} -setup {
2120 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2124 .c configure -selectimage bogus
2127 } -returnCodes {error} -result {image "bogus" doesn't exist}
2128 test button-1.217 {configuration option: "selectimage" for radiobutton} -constraints {
2131 image create test image1
2132 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2136 .r configure -selectimage image1
2137 .r cget -selectimage
2142 test button-1.218 {configuration option: "selectimage" for radiobutton} -setup {
2143 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2147 .r configure -selectimage bogus
2150 } -returnCodes {error} -result {image "bogus" doesn't exist}
2152 test button-1.219 {configuration option: "state" for label} -setup {
2153 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2157 .l configure -state normal
2162 test button-1.220 {configuration option: "state" for label} -setup {
2163 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2167 .l configure -state bogus
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}
2176 .b configure -state normal
2181 test button-1.222 {configuration option: "state" for button} -setup {
2182 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2186 .b configure -state bogus
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}
2195 .c configure -state normal
2200 test button-1.224 {configuration option: "state" for checkbutton} -setup {
2201 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2205 .c configure -state bogus
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}
2214 .r configure -state normal
2219 test button-1.226 {configuration option: "state" for radiobutton} -setup {
2220 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2224 .r configure -state bogus
2227 } -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
2229 test button-1.227 {configuration option: "takefocus" for label} -setup {
2230 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2234 .l configure -takefocus "any string"
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}
2244 .b configure -takefocus "any string"
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}
2254 .c configure -takefocus "any string"
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}
2264 .r configure -takefocus "any string"
2268 } -result {any string}
2270 test button-1.231 {configuration option: "text" for label} -setup {
2271 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2275 .l configure -text "Sample text"
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}
2285 .b configure -text "Sample text"
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}
2295 .c configure -text "Sample text"
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}
2305 .r configure -text "Sample text"
2309 } -result {Sample text}
2311 test button-1.235 {configuration option: "textvariable" for label} -setup {
2312 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2316 .l configure -textvariable i
2317 .l cget -textvariable
2321 test button-1.236 {configuration option: "textvariable" for button} -setup {
2322 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2326 .b configure -textvariable i
2327 .b cget -textvariable
2331 test button-1.237 {configuration option: "textvariable" for checkbutton} -setup {
2332 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2336 .c configure -textvariable i
2337 .c cget -textvariable
2341 test button-1.238 {configuration option: "textvariable" for radiobutton} -setup {
2342 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2346 .r configure -textvariable i
2347 .r cget -textvariable
2352 test button-1.239 {configuration option: "tristateimage" for checkbutton} -constraints {
2355 image create test image1
2356 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2360 .c configure -tristateimage image1
2361 .c cget -tristateimage
2366 test button-1.240 {configuration option: "tristateimage" for checkbutton} -setup {
2367 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2371 .c configure -tristateimage bogus
2374 } -returnCodes {error} -result {image "bogus" doesn't exist}
2375 test button-1.241 {configuration option: "tristateimage" for radiobutton} -constraints {
2378 image create test image1
2379 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2383 .r configure -tristateimage image1
2384 .r cget -tristateimage
2389 test button-1.242 {configuration option: "tristateimage" for radiobutton} -setup {
2390 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2394 .r configure -tristateimage bogus
2397 } -returnCodes {error} -result {image "bogus" doesn't exist}
2399 test button-1.243 {configuration option: "underline" for label} -setup {
2400 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2404 .l configure -underline 5
2409 test button-1.244 {configuration option: "underline" for label} -setup {
2410 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2414 .l configure -underline 3p
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}
2423 .b configure -underline 5
2428 test button-1.246 {configuration option: "underline" for button} -setup {
2429 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2433 .b configure -underline 3p
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}
2442 .c configure -underline 5
2447 test button-1.248 {configuration option: "underline" for checkbutton} -setup {
2448 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2452 .c configure -underline 3p
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}
2461 .r configure -underline 5
2466 test button-1.250 {configuration option: "underline" for radiobutton} -setup {
2467 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2471 .r configure -underline 3p
2474 } -returnCodes {error} -result {expected integer but got "3p"}
2476 test button-1.251 {configuration option: "tristatevalue" for checkbutton} -setup {
2477 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2481 .c configure -tristatevalue unknowable
2482 .c cget -tristatevalue
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}
2491 .r configure -tristatevalue unknowable
2492 .r cget -tristatevalue
2495 } -result {unknowable}
2497 test button-1.253 {configuration option: "value" for radiobutton} -setup {
2498 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2502 .r configure -value anyString
2506 } -result {anyString}
2508 test button-1.254 {configuration option: "width" for label} -setup {
2509 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2513 .l configure -width 402
2518 test button-1.255 {configuration option: "width" for label} -setup {
2519 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2523 .l configure -width 3p
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}
2532 .b configure -width 402
2537 test button-1.257 {configuration option: "width" for button} -setup {
2538 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2542 .b configure -width 3p
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}
2551 .c configure -width 402
2556 test button-1.259 {configuration option: "width" for checkbutton} -setup {
2557 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2561 .c configure -width 3p
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}
2570 .r configure -width 402
2575 test button-1.261 {configuration option: "width" for radiobutton} -setup {
2576 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2580 .r configure -width 3p
2583 } -returnCodes {error} -result {expected integer but got "3p"}
2585 test button-1.262 {configuration option: "wraplength" for label} -setup {
2586 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2590 .l configure -wraplength 100
2595 test button-1.263 {configuration option: "wraplength" for label} -setup {
2596 label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2600 .l configure -wraplength 6x
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}
2609 .b configure -wraplength 100
2614 test button-1.265 {configuration option: "wraplength" for button} -setup {
2615 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2619 .b configure -wraplength 6x
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}
2628 .c configure -wraplength 100
2633 test button-1.267 {configuration option: "wraplength" for checkbutton} -setup {
2634 checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2638 .c configure -wraplength 6x
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}
2647 .r configure -wraplength 100
2652 test button-1.269 {configuration option: "wraplength" for radiobutton} -setup {
2653 radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
2657 .r configure -wraplength 6x
2660 } -returnCodes {error} -result {bad screen distance "6x"}
2662 test button-1.270 {configuration options} -body {
2663 # Additional check to make sure that -selectcolor may be empty in
2666 .c configure -selectcolor {}
2672 test button-2.1 {ButtonCreate - not enough arguments} -body {
2674 } -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"}
2676 test button-2.2 {ButtonCreate procedure - setting label class} -body {
2682 test button-2.3 {ButtonCreate - setting button class} -body {
2688 test button-2.4 {ButtonCreate - setting checkbutton class} -body {
2693 } -result {Checkbutton}
2694 test button-2.5 {ButtonCreate - setting radiobutton class} -body {
2699 } -result {Radiobutton}
2700 test button-2.6 {ButtonCreate - setting class} -body {
2709 test button-2.7 {ButtonCreate - bad window name} -body {
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
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}
2729 } -result {unknown color name "bogus"
2730 (database entry for "-background" in widget ".funny")
2734 test button-2.10 {ButtonCreate procedure - option error} -body {
2738 } -returnCodes {error} -result {unknown option "-gorp"}
2739 test button-2.11 {ButtonCreate procedure - option error} -body {
2740 catch {button .x -gorp foo}
2746 test button-2.12 {ButtonCreate procedure - return value} -body {
2747 set x [button .abcd]
2754 test button-3.1 {ButtonWidgetCmd - too few arguments} -body {
2759 } -returnCodes {error} -result {wrong # args: should be ".b option ?arg ...?"}
2760 test button-3.2 {ButtonWidgetCmd - bad option name} -body {
2765 } -returnCodes {error} -result {ambiguous option "c": must be cget, configure, flash, or invoke}
2766 test button-3.3 {ButtonWidgetCmd - bad option name} -body {
2771 } -returnCodes {error} -result {bad option "bogus": must be cget, configure, flash, or invoke}
2772 test button-3.4 {ButtonWidgetCmd procedure, "cget" option} -body {
2777 } -returnCodes {error} -result {wrong # args: should be ".b cget option"}
2778 test button-3.5 {ButtonWidgetCmd procedure, "cget" option} -body {
2783 } -returnCodes {error} -result {unknown option "-gorp"}
2786 test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body {
2788 .l cget -disabledforeground
2791 } -returnCodes {ok} -match {glob} -result {*}
2792 test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body {
2794 .b cget -disabledforeground
2797 } -returnCodes {ok} -match {glob} -result {*}
2798 test button-3.8 {ButtonWidgetCmd procedure, "cget" option} -body {
2803 } -returnCodes {error} -result {unknown option "-variable"}
2805 test button-3.9 {ButtonWidgetCmd procedure, "cget" option} -body {
2810 } -returnCodes {ok} -match {glob} -result {*}
2811 test button-3.10 {ButtonWidgetCmd procedure, "cget" option} -body {
2816 } -returnCodes {error} -result {unknown option "-value"}
2818 test button-3.11 {ButtonWidgetCmd procedure, "cget" option} -body {
2823 } -returnCodes {ok} -match {glob} -result {*}
2824 test button-3.12 {ButtonWidgetCmd procedure, "cget" option} -body {
2829 } -returnCodes {error} -result {unknown option "-onvalue"}
2832 test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body {
2833 button .b -highlightthickness 3
2834 lindex [.b configure -highlightthickness] 4
2838 test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -body {
2840 llength [.c configure]
2844 test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body {
2849 } -returnCodes {error} -result {unknown option "-gorp"}
2850 test button-3.16 {ButtonWidgetCmd procedure, "configure" option} -setup {
2853 .b co -bg #ffffff -fg
2856 } -returnCodes {error} -result {value for "-fg" missing}
2857 test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup {
2860 .b configure -fg #123456
2861 .b configure -bg #654321
2862 lindex [.b configure -fg] 4
2866 test button-3.18 {ButtonWidgetCmd procedure, "deselect" option} -body {
2871 } -returnCodes {error} -result {wrong # args: should be ".c deselect"}
2872 test button-3.19 {ButtonWidgetCmd procedure, "deselect" option} -body {
2877 } -returnCodes {error} -result {bad option "deselect": must be cget or configure}
2878 test button-3.20 {ButtonWidgetCmd procedure, "deselect" option} -body {
2883 } -returnCodes {error} -result {bad option "deselect": must be cget, configure, flash, or invoke}
2885 test button-3.21 {ButtonWidgetCmd procedure, "deselect" option} -body {
2886 checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
2893 test button-3.22 {ButtonWidgetCmd procedure, "deselect" option} -body {
2894 radiobutton .r -variable radiovar -value red
2901 test button-3.23 {ButtonWidgetCmd procedure, "deselect" option} -body {
2902 radiobutton .r -variable radiovar -value red
2910 test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body {
2911 checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
2913 trace variable checkvar w bogusTrace
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
2922 trace variable checkvar w bogusTrace
2924 list $errorInfo $checkvar
2926 trace vdelete checkvar w bogusTrace
2928 } -match {glob} -result {{*trace aborted
2932 test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body {
2933 radiobutton .r -variable radiovar -value red
2935 trace variable radiovar w bogusTrace
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
2944 trace variable radiovar w bogusTrace
2946 list $errorInfo $radiovar
2949 trace vdelete radiovar w bogusTrace
2950 } -match glob -result {{*trace aborted
2955 test button-3.28 {ButtonWidgetCmd procedure, "flash" option} -body {
2960 } -returnCodes {error} -result {wrong # args: should be ".b flash"}
2961 test button-3.29 {ButtonWidgetCmd procedure, "flash" option} -body {
2966 } -returnCodes {error} -result {bad option "flash": must be cget or configure}
2967 test button-3.30 {ButtonWidgetCmd procedure, "flash" option} -body {
2972 } -returnCodes {ok} -match {glob} -result {*}
2973 test button-3.31 {ButtonWidgetCmd procedure, "flash" option} -body {
2978 } -returnCodes {ok} -match {glob} -result {*}
2979 test button-3.32 {ButtonWidgetCmd procedure, "flash" option} -body {
2984 } -returnCodes {ok} -match {glob} -result {*}
2986 test button-3.33 {ButtonWidgetCmd procedure, "invoke" option} -body {
2991 } -returnCodes {error} -result {bad option "invoke": must be cget or configure}
2992 test button-3.34 {ButtonWidgetCmd procedure, "invoke" option} -body {
2997 } -returnCodes {error} -result {wrong # args: should be ".b invoke"}
2998 test button-3.35 {ButtonWidgetCmd procedure, "invoke" option} -body {
3000 .b configure -command {set x invoked}
3007 test button-3.36 {ButtonWidgetCmd procedure, "invoke" option} -body {
3009 .b configure -command {set x invoked} -state disabled
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}
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
3034 } -result {invoked red}
3036 test button-3.39 {ButtonWidgetCmd procedure, "select" option} -body {
3041 } -returnCodes {error} -result {bad option "select": must be cget or configure}
3042 test button-3.40 {ButtonWidgetCmd procedure, "select" option} -body {
3047 } -returnCodes {error} -result {bad option "select": must be cget, configure, flash, or invoke}
3048 test button-3.41 {ButtonWidgetCmd procedure, "select" option} -body {
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
3062 test button-3.43 {ButtonWidgetCmd procedure, "select" option} -body {
3063 radiobutton .r -variable radiovar -value red
3070 test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body {
3071 radiobutton .r -variable radiovar -value red
3073 trace variable radiovar w bogusTrace
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
3082 trace variable radiovar w bogusTrace
3084 list $errorInfo $radiovar
3087 trace vdelete radiovar w bogusTrace
3088 } -match {glob} -result {{*trace aborted
3094 test button-3.46 {ButtonWidgetCmd procedure, "toggle" option} -body {
3099 } -returnCodes {error} -result {bad option "toggle": must be cget or configure}
3100 test button-3.47 {ButtonWidgetCmd procedure, "toggle" option} -body {
3105 } -returnCodes {error} -result {bad option "toggle": must be cget, configure, flash, or invoke}
3106 test button-3.48 {ButtonWidgetCmd procedure, "toggle" option} -body {
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 {
3117 } -returnCodes {error} -result {wrong # args: should be ".c toggle"}
3118 test button-3.50 {ButtonWidgetCmd procedure, "toggle" option} -body {
3120 checkbutton .c -variable checkvar -onvalue sunshine -offvalue rain
3122 set result $checkvar
3124 lappend result $checkvar
3126 lappend result $checkvar
3130 } -result {sunshine rain sunshine}
3131 test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body {
3132 checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3134 trace variable checkvar w bogusTrace
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
3143 trace variable checkvar w bogusTrace
3145 list $errorInfo $checkvar
3147 trace vdelete checkvar w bogusTrace
3149 } -match {glob} -result {{*trace aborted
3153 test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body {
3154 checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3156 trace variable checkvar w bogusTrace
3159 trace vdelete checkvar w bogusTrace
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
3165 trace variable checkvar w bogusTrace
3167 list $errorInfo $checkvar
3169 trace vdelete checkvar w bogusTrace
3171 } -match {glob} -result {{*trace aborted
3175 test button-3.55 {ButtonWidgetCmd procedure, "toggle" option} -setup {
3176 unset -nocomplain checkvar
3178 checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
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
3188 checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
3195 } -match {glob} -result {can't set "checkvar": variable is array
3199 test button-4.1 {DestroyButton procedure} -constraints {
3202 image create test image1
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"
3211 pack .b1 .b2 .b3 .b4 .b5
3215 destroy .b1 .b2 .b3 .b4 .b5
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
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]
3232 test button-5.3 {ConfigureButton - textvariable trace} -body {
3233 button .b -textvariable x
3236 .b configure -textvariable y
3238 lindex [.b configure -text] 4
3242 test button-5.4 {ConfigureButton - variable trace} -body { ;# ex 6.2a
3243 checkbutton .c -variable x
3246 .c configure -textvariable y
3254 test button-5.5 {ConfigureButton - image handling} -constraints {
3258 image create test image1
3259 image create test image2
3261 button .b -image image1
3263 .b configure -image image2
3270 test button-5.6 {ConfigureButton - default value for variable} -body {
3276 test button-5.7 {ConfigureButton - setting selected state from variable} -body {
3279 checkbutton .c -variable x
3280 .c configure -variable y -onvalue Shiny
3286 test button-5.8 {ConfigureButton - setting selected state from variable} -setup {
3289 checkbutton .c -variable x -offvalue Bogus
3295 test button-5.9 {ConfigureButton - setting selected state from variable} -setup {
3298 radiobutton .r -variable x
3304 test button-5.10 {ConfigureButton - error in setting variable} -setup {
3307 trace variable x w bogusTrace
3308 radiobutton .r -variable x
3311 trace vdelete x w bogusTrace
3312 } -returnCodes {error} -result {can't set "x": trace aborted}
3314 test button-5.11 {ConfigureButton - bad image name} -body {
3315 button .b -image bogus
3318 } -returnCodes {error} -result {image "bogus" doesn't exist}
3320 test button-5.12 {ConfigureButton - setting variable from current text value} -setup {
3323 button .b -textvariable x -text "Button 1"
3327 } -result {Button 1}
3329 test button-5.13 {ConfigureButton - using current value of variable} -body {
3331 button .b -textvariable x -text "Button 1"
3335 } -result {Override}
3337 test button-5.14 {ConfigureButton - variable handling} -setup {
3340 trace variable x w bogusTrace
3341 radiobutton .r -text foo -textvariable x
3343 trace vdelete x w bogusTrace
3345 } -returnCodes {error} -result {can't set "x": trace aborted}
3346 test button-5.15 {ConfigureButton - variable handling} -setup {
3349 trace variable x w bogusTrace
3350 catch {radiobutton .r -text foo -textvariable x}
3353 trace vdelete x w bogusTrace
3358 test button-5.16 {ConfigureButton - -width option} -body {
3359 button .b -text "Button 1"
3360 .b configure -width 1i
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}
3370 } -result {expected integer but got "1i"
3371 (processing -width option)
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
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}
3386 } -result {expected integer but got "0.5c"
3387 (processing -height option)
3389 ".b configure -height 0.5c"}
3391 test button-5.20 {ConfigureButton - -width option} -body {
3392 button .b -bitmap questhead
3393 .b configure -width abc
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}
3403 } -result {bad screen distance "abc"
3404 (processing -width option)
3406 ".b configure -width abc"}
3407 test button-5.22 {ConfigureButton - -height option} -constraints {
3410 image create test image1
3412 button .b -image image1
3413 .b configure -height 0.5x
3417 } -returnCodes {error} -result {bad screen distance "0.5x"}
3418 test button-5.23 {ConfigureButton - -height option} -constraints {
3421 image create test image1
3424 button .b -image image1
3425 catch {.b configure -height 0.5x}
3430 } -result {bad screen distance "0.5x"
3431 (processing -height option)
3433 ".b configure -height 0.5x"}
3435 test button-5.24 {ConfigureButton - computing geometry} -constraints {
3438 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
3440 # 1. button with text
3441 .b configure -text "Sample text"
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};
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]}]
3480 test button-5.25 {ConfigureButton - computing geometry} -setup {
3481 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
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]
3492 test button-6.1 {ButtonEventProc procedure} -body {
3493 button .b -text "Test Button" -command {
3495 set x [list [winfo exists .b] [info commands .b]]
3503 test button-6.2 {ButtonEventProc procedure} -setup {
3506 button .b1 -bg #543210
3508 lappend x [winfo children .]
3509 lappend x [.b2 cget -bg]
3511 lappend x [info command .b*] [winfo children .]
3514 } -result {.b1 #543210 {} {}}
3516 test button-7.1 {ButtonCmdDeletedProc procedure} -body {
3519 list [info command .b*] [winfo children .]
3524 test button-8.1 {TkInvokeButton procedure} -setup {
3527 checkbutton .c -variable x
3537 test button-8.2 {TkInvokeButton procedure} -setup {
3540 checkbutton .c -variable x
3541 trace variable x w bogusTrace
3545 trace vdelete x w bogusTrace
3546 } -returnCodes {error} -result {can't set "x": trace aborted}
3547 test button-8.3 {TkInvokeButton procedure} -setup {
3550 checkbutton .c -variable x
3551 trace variable x w bogusTrace
3556 trace vdelete x w bogusTrace
3558 test button-8.4 {TkInvokeButton procedure} -setup {
3561 checkbutton .c -variable x
3562 trace variable x w bogusTrace
3566 trace vdelete x w bogusTrace
3567 } -returnCodes {error} -result {can't set "x": trace aborted}
3568 test button-8.5 {TkInvokeButton procedure} -setup {
3571 checkbutton .c -variable x
3572 trace variable x w bogusTrace
3577 trace vdelete x w bogusTrace
3580 test button-8.6 {TkInvokeButton procedure} -setup {
3583 radiobutton .r -variable x -value red
3591 } -result {0 red red}
3593 test button-8.7 {TkInvokeButton procedure} -body {
3594 radiobutton .r -variable x -value red
3596 trace variable x w bogusTrace
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
3605 trace variable x w bogusTrace
3610 trace vdelete x w bogusTrace
3611 } -match {glob} -result {{*trace aborted
3617 test button-8.9 {TkInvokeButton procedure} -setup {
3618 set result untouched
3620 button .b -command {set result invoked}
3625 } -result {invoked invoked}
3626 test button-8.10 {TkInvokeButton procedure} -setup {
3627 set result untouched
3630 checkbutton .c -variable x -command {set result "invoked $x"}
3635 } -result {{invoked 1} {invoked 1}}
3636 test button-8.11 {TkInvokeButton procedure} -setup {
3637 set result untouched
3640 radiobutton .r -variable x -value red -command {set result "invoked $x"}
3645 } -result {{invoked red} {invoked red}}
3647 test button-9.1 {ButtonVarProc procedure} -body {
3649 checkbutton .c -variable x
3651 set result [info exists x]
3660 test button-9.2 {ButtonVarProc procedure} -body {
3662 checkbutton .c -variable x
3669 test button-9.3 {ButtonVarProc procedure} -setup {
3672 checkbutton .c -variable x
3679 test button-9.4 {ButtonVarProc procedure} -setup {
3682 checkbutton .c -variable x
3689 test button-9.5 {ButtonVarProc procedure} -setup {
3692 checkbutton .c -variable x
3699 test button-9.6 {ButtonVarProc procedure} -setup {
3702 checkbutton .c -variable x
3709 test button-9.7 {ButtonVarProc procedure} -setup {
3712 checkbutton .c -variable x
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.
3723 checkbutton .c -variable a
3731 test button-10.1 {ButtonTextVarProc procedure} -body {
3733 button .b -textvariable x
3735 set result [list $x [.b cget -text]]
3737 lappend result [.b cget -text]
3740 } -result {Label Label New}
3741 test button-10.2 {ButtonTextVarProc procedure} -setup {
3742 button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
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]
3750 set new [winfo reqwidth .b]
3756 test button-11.1 {ButtonImageProc procedure} -constraints {
3759 label .l -highlightthickness 0 -font {Helvetica -12 bold}
3760 image create test image1
3762 .l configure -image image1 -padx 0 -pady 0 -bd 0
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]
3770 } -result {30 15 80 100}
3772 test button-12.1 {button widget vs hidden commands} -body {
3773 button .b -text hello
3774 set l [interp hidden]
3778 set res1 [list [winfo children .] [interp hidden]]
3779 set res2 [list {} $l]
3780 expr {$res1 == $res2}
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}
3791 .a configure -text Hej
3792 .b configure -text Hej -width 10 -height 1
3793 .c configure -text "" -width 10 -height 1
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]}]
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}
3810 .a configure -text Hej
3811 .b configure -text Hej -width 10 -height 1
3812 .c configure -text "" -width 10 -height 1
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]}]
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}
3830 .a configure -text Hej
3831 .b configure -text Hej -width 10 -height 1
3832 .c configure -text "" -width 10 -height 1
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]}]
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}
3849 .a configure -text Hej
3850 .b configure -text Hej -width 10 -height 1
3851 .c configure -text "" -width 10 -height 1
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]}]
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}
3869 .a configure -text Hej
3870 .b configure -text Hej -width 10 -height 1
3871 .c configure -text "" -width 10 -height 1
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]}]
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}
3889 .a configure -text Hej
3890 .b configure -text Hej -width 10 -height 1
3891 .c configure -text "" -width 10 -height 1
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]}]
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}
3909 .a configure -text Hej
3910 .b configure -text Hej -width 10 -height 1
3911 .c configure -text "" -width 10 -height 1
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]}]
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}
3929 .a configure -text Hej
3930 .b configure -text Hej -width 10 -height 1
3931 .c configure -text "" -width 10 -height 1
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]}]
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]} {
3950 button .top.b -text Foo -command destroy_button
3951 bind .top.b <space> destroy_button
3955 event generate .top.b <space>
3956 update ; # shall not trigger error invalid command name ".top.b"
3961 test button-15.1 {Bug [5d991b822e]} {
3962 # Want this not to segfault
3964 button .b -textvariable var
3965 trace add variable var unset {apply {args {
3966 .b configure -textvariable {}
3969 bind .b <Configure> {unset var}
3973 test button-15.2 {Bug [5d991b822e]} {
3974 # Want this not to leak traces
3976 button .b -textvariable var
3977 trace add variable var unset {apply {args {
3978 .b configure -textvariable new
3981 bind .b <Configure> {unset -nocomplain var}
3986 test button-15.3 {Bug [5d991b822e]} {
3987 # Want this not to leak traces
3989 checkbutton .b -variable var
3990 trace add variable var unset {apply {args {
3991 .b configure -variable {}
3994 bind .b <Configure> {unset var}