1 # This file is a Tcl script to test menus in Tk. It is
2 # organized in the standard fashion for Tcl tests.
4 # Copyright (c) 1995-1997 Sun Microsystems, Inc.
5 # Copyright (c) 1998-1999 by Scriptics Corporation.
8 package require tcltest 2.2
9 namespace import ::tcltest::*
10 eval tcltest::configure $argv
11 tcltest::loadTestedCommands
14 # find the earth.gif file for use in these tests (tests 2.*)
15 set earthPhotoFile [file join [file dirname [info script]] earth.gif]
16 testConstraint hasEarthPhoto [file exists $earthPhotoFile]
18 test menu-1.1 {Tk_MenuCmd procedure} -body {
20 } -returnCodes error -result {wrong # args: should be "menu pathName ?-option value ...?"}
21 test menu-1.2 {Tk_MenuCmd procedure} -body {
23 } -returnCodes error -result {bad window path name "bogus"}
24 test menu-1.3 {Tk_MenuCmd procedure} -body {
27 } -returnCodes error -result {unknown option "foo"}
28 test menu-1.4 {Tk_MenuCmd procedure} -body {
34 test menu-1.5 {Tk_MenuCmd - creating menubar} -setup {
38 .m1 add cascade -label Test -menu ""
39 list [. configure -menu .m1] [. configure -menu ""]
43 test menu-1.6 {Tk_MenuCmd procedure menu ref no cascade} -setup {
46 toplevel .t2 -menu .m1
52 test menu-1.7 {Tk_MenuCmd procedure one clone cascade} -setup {
55 toplevel .t2 -menu .m1
58 .m1 add cascade -menu .m2
63 test menu-1.8 {Tk_MenuCmd procedure two clone cascades} -setup {
67 .m1 add cascade -menu .m2
68 toplevel .t2 -menu .m1
70 toplevel .t3 -menu .m1
76 test menu-1.9 {Tk_MenuCmd procedure two clone cascades different order} -setup {
79 toplevel .t2 -menu .m1
82 .m1 add cascade -menu .m2
83 toplevel .t3 -menu .m1
89 test menu-1.10 {Tk_MenuCmd procedure two clone cascades menus last} -setup {
92 toplevel .t2 -menu .m1
94 toplevel .t3 -menu .m1
97 .m1 add cascade -menu .m2
102 test menu-1.11 {Tk_MenuCmd procedure three clones cascades} -setup {
105 toplevel .t2 -menu .m1
107 toplevel .t3 -menu .m1
109 toplevel .t4 -menu .m1
112 .m1 add cascade -menu .m2
117 test menu-1.12 {Tk_MenuCmd procedure} -setup {
120 toplevel .t2 -menu .m1
126 test menu-1.13 {Tk_MenuCmd procedure} -setup {
129 toplevel .t2 -menu .m1
131 toplevel .t3 -menu .m1
137 test menu-1.14 {Tk_MenuCmd procedure} -setup {
140 toplevel .t2 -menu .m1
142 toplevel .t3 -menu .m1
144 toplevel .t4 -menu .m1
151 # Used for 2.1 - 2.30 tests
154 test menu-2.1 {configuration options -activebackground #012345} -body {
155 .m1 configure -activebackground #012345
156 .m1 cget -activebackground
158 test menu-2.2 {configuration options -activebackground non-existent} -body {
159 .m1 configure -activebackground non-existent
160 } -returnCodes error -result {unknown color name "non-existent"}
162 test menu-2.3 {configuration options -activeborderwidth 1.3} -body {
163 .m1 configure -activeborderwidth 1.3
164 .m1 cget -activeborderwidth
166 test menu-2.4 {configuration options -activeborderwidth badValue} -body {
167 .m1 configure -activeborderwidth badValue
168 } -returnCodes error -result {bad screen distance "badValue"}
170 test menu-2.5 {configuration options -activeforeground #ff0000} -body {
171 .m1 configure -activeforeground #ff0000
172 .m1 cget -activeforeground
174 test menu-2.6 {configuration options -activeforeground non-existent} -body {
175 .m1 configure -activeforeground non-existent
176 } -returnCodes error -result {unknown color name "non-existent"}
178 test menu-2.7 {configuration options -background #ff0000} -body {
179 .m1 configure -background #ff0000
182 test menu-2.8 {configuration options -background non-existent} -body {
183 .m1 configure -background non-existent
184 } -returnCodes error -result {unknown color name "non-existent"}
186 test menu-2.9 {configuration options -bg #110022} -body {
187 .m1 configure -bg #110022
190 test menu-2.10 {configuration options -bg bogus} -body {
191 .m1 configure -bg bogus
192 } -returnCodes error -result {unknown color name "bogus"}
194 test menu-2.11 {configuration options -borderwidth 1.3} -body {
195 .m1 configure -borderwidth 1.3
196 .m1 cget -borderwidth
198 test menu-2.12 {configuration options -borderwidth badValue} -body {
199 .m1 configure -borderwidth badValue
200 } -returnCodes error -result {bad screen distance "badValue"}
202 test menu-2.13 {configuration options -cursor arrow} -body {
203 .m1 configure -cursor arrow
206 test menu-2.14 {configuration options -cursor badValue} -body {
207 .m1 configure -cursor badValue
208 } -returnCodes error -result {bad cursor spec "badValue"}
210 test menu-2.15 {configuration options -disabledforeground #00ff00} -body {
211 .m1 configure -disabledforeground #00ff00
212 .m1 cget -disabledforeground
214 test menu-2.16 {configuration options -disabledforeground xyzzy} -body {
215 .m1 configure -disabledforeground xyzzy
216 } -returnCodes error -result {unknown color name "xyzzy"}
218 test menu-2.17 {configuration options -fg #110022} -body {
219 .m1 configure -fg #110022
222 test menu-2.18 {configuration options -fg bogus} -body {
223 .m1 configure -fg bogus
224 } -returnCodes error -result {unknown color name "bogus"}
226 test menu-2.19 {configuration options -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*} -body {
227 .m1 configure -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
229 } -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
230 test menu-2.20 {configuration options -foreground #110022} -body {
231 .m1 configure -foreground #110022
234 test menu-2.21 {configuration options -foreground bogus} -body {
235 .m1 configure -foreground bogus
236 } -returnCodes error -result {unknown color name "bogus"}
238 test menu-2.22 {configuration options -postcommand {any old string}} -body {
239 .m1 configure -postcommand {any old string}
240 .m1 cget -postcommand
241 } -result {any old string}
242 test menu-2.23 {configuration options -relief groove} -body {
243 .m1 configure -relief groove
246 test menu-2.24 {configuration options -relief 1.5} -body {
247 .m1 configure -relief 1.5
248 } -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
250 test menu-2.25 {configuration options -selectcolor #110022} -body {
251 .m1 configure -selectcolor #110022
252 .m1 cget -selectcolor
254 test menu-2.26 {configuration options -selectcolor bogus} -body {
255 .m1 configure -selectcolor bogus
256 } -returnCodes error -result {unknown color name "bogus"}
258 test menu-2.27 {configuration options -takefocus {any string}} -body {
259 .m1 configure -takefocus {any string}
261 } -result {any string}
262 test menu-2.28 {configuration options -tearoff 0} -body {
263 .m1 configure -tearoff 0
266 test menu-2.29 {configuration options -tearoff 1} -body {
267 .m1 configure -tearoff 1
270 test menu-2.30 {configuration options -tearoffcommand {any old string}} -body {
271 .m1 configure -tearoffcommand {any old string}
272 .m1 cget -tearoffcommand
273 } -result {any old string}
276 # We need to test all of the options with all of the different types of
277 # menu entries. The following code sets up .m1 with 6 items. It then
278 # runs through the 2.31 - 2.228 tests below
279 # index 0 is tearoff, 1 command, 2 cascade, 3 separator, 4 checkbutton,
283 .m1 add command -label "command"
285 .m2 add command -label "test"
286 .m1 add cascade -label "cascade" -menu .m2
288 .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off
289 .m1 add radiobutton -label "radiobutton" -variable radio
291 if {[testConstraint hasEarthPhoto]} {
292 image create photo image1 -file $earthPhotoFile
295 test menu-2.31 {entry configuration options 0 -activebackground #012345 tearoff} -body {
296 .m1 entryconfigure 0 -activebackground #012345
297 } -returnCodes error -result {unknown option "-activebackground"}
299 test menu-2.32 {entry configuration options 1 -activebackground #012345 command} -body {
300 .m1 entryconfigure 1 -activebackground #012345
301 lindex [.m1 entryconfigure 1 -activebackground] 4
304 test menu-2.33 {entry configuration options 2 -activebackground #012345 cascade} -body {
305 .m1 entryconfigure 2 -activebackground #012345
306 lindex [.m1 entryconfigure 2 -activebackground] 4
309 test menu-2.34 {entry configuration options 3 -activebackground #012345 separator} -body {
310 .m1 entryconfigure 3 -activebackground #012345
311 } -returnCodes error -result {unknown option "-activebackground"}
313 test menu-2.35 {entry configuration options 4 -activebackground #012345 checkbutton} -body {
314 .m1 entryconfigure 4 -activebackground #012345
315 lindex [.m1 entryconfigure 4 -activebackground] 4
318 test menu-2.36 {entry configuration options 5 -activebackground #012345 radiobutton} -body {
319 .m1 entryconfigure 5 -activebackground #012345
320 lindex [.m1 entryconfigure 5 -activebackground] 4
323 test menu-2.37 {entry configuration options 0 -activebackground non-existent tearoff} -body {
324 .m1 entryconfigure 0 -activebackground non-existent
325 } -returnCodes error -result {unknown option "-activebackground"}
327 test menu-2.38 {entry configuration options 1 -activebackground non-existent command} -body {
328 .m1 entryconfigure 1 -activebackground non-existent
329 } -returnCodes error -result {unknown color name "non-existent"}
331 test menu-2.39 {entry configuration options 2 -activebackground non-existent cascade} -body {
332 .m1 entryconfigure 2 -activebackground non-existent
333 } -returnCodes error -result {unknown color name "non-existent"}
335 test menu-2.40 {entry configuration options 3 -activebackground non-existent separator} -body {
336 .m1 entryconfigure 3 -activebackground non-existent
337 } -returnCodes error -result {unknown option "-activebackground"}
339 test menu-2.41 {entry configuration options 4 -activebackground non-existent checkbutton} -body {
340 .m1 entryconfigure 4 -activebackground non-existent
341 } -returnCodes error -result {unknown color name "non-existent"}
343 test menu-2.42 {entry configuration options 5 -activebackground non-existent radiobutton} -body {
344 .m1 entryconfigure 5 -activebackground non-existent
345 } -returnCodes error -result {unknown color name "non-existent"}
347 test menu-2.43 {entry configuration options 0 -activeforeground #ff0000 tearoff} -body {
348 .m1 entryconfigure 0 -activeforeground #ff0000
349 } -returnCodes error -result {unknown option "-activeforeground"}
351 test menu-2.44 {entry configuration options 1 -activeforeground #ff0000 command} -body {
352 .m1 entryconfigure 1 -activeforeground #ff0000
353 lindex [.m1 entryconfigure 1 -activeforeground] 4
356 test menu-2.45 {entry configuration options 2 -activeforeground #ff0000 cascade} -body {
357 .m1 entryconfigure 2 -activeforeground #ff0000
358 lindex [.m1 entryconfigure 2 -activeforeground] 4
361 test menu-2.46 {entry configuration options 3 -activeforeground #ff0000 separator} -body {
362 .m1 entryconfigure 3 -activeforeground #ff0000
363 } -returnCodes error -result {unknown option "-activeforeground"}
365 test menu-2.47 {entry configuration options 4 -activeforeground #ff0000 checkbutton} -body {
366 .m1 entryconfigure 4 -activeforeground #ff0000
367 lindex [.m1 entryconfigure 4 -activeforeground] 4
370 test menu-2.48 {entry configuration options 5 -activeforeground #ff0000 radiobutton} -body {
371 .m1 entryconfigure 5 -activeforeground #ff0000
372 lindex [.m1 entryconfigure 5 -activeforeground] 4
375 test menu-2.49 {entry configuration options 0 -activeforeground non-existent tearoff} -body {
376 .m1 entryconfigure 0 -activeforeground non-existent
377 } -returnCodes error -result {unknown option "-activeforeground"}
379 test menu-2.50 {entry configuration options 1 -activeforeground non-existent command} -body {
380 .m1 entryconfigure 1 -activeforeground non-existent
381 } -returnCodes error -result {unknown color name "non-existent"}
383 test menu-2.51 {entry configuration options 2 -activeforeground non-existent cascade} -body {
384 .m1 entryconfigure 2 -activeforeground non-existent
385 } -returnCodes error -result {unknown color name "non-existent"}
387 test menu-2.52 {entry configuration options 3 -activeforeground non-existent separator} -body {
388 .m1 entryconfigure 3 -activeforeground non-existent
389 } -returnCodes error -result {unknown option "-activeforeground"}
391 test menu-2.53 {entry configuration options 4 -activeforeground non-existent checkbutton} -body {
392 .m1 entryconfigure 4 -activeforeground non-existent
393 } -returnCodes error -result {unknown color name "non-existent"}
395 test menu-2.54 {entry configuration options 5 -activeforeground non-existent radiobutton} -body {
396 .m1 entryconfigure 5 -activeforeground non-existent
397 } -returnCodes error -result {unknown color name "non-existent"}
399 test menu-2.55 {entry configuration options 0 -accelerator Ctrl+S tearoff} -body {
400 .m1 entryconfigure 0 -accelerator Ctrl+S
401 } -returnCodes error -result {unknown option "-accelerator"}
403 test menu-2.56 {entry configuration options 1 -accelerator Ctrl+S command} -body {
404 .m1 entryconfigure 1 -accelerator Ctrl+S
405 lindex [.m1 entryconfigure 1 -accelerator] 4
408 test menu-2.57 {entry configuration options 2 -accelerator Ctrl+S cascade} -body {
409 .m1 entryconfigure 2 -accelerator Ctrl+S
410 lindex [.m1 entryconfigure 2 -accelerator] 4
413 test menu-2.58 {entry configuration options 3 -accelerator Ctrl+S separator} -body {
414 .m1 entryconfigure 3 -accelerator Ctrl+S
415 } -returnCodes error -result {unknown option "-accelerator"}
417 test menu-2.59 {entry configuration options 4 -accelerator Ctrl+S checkbutton} -body {
418 .m1 entryconfigure 4 -accelerator Ctrl+S
419 lindex [.m1 entryconfigure 4 -accelerator] 4
422 test menu-2.60 {entry configuration options 5 -accelerator Ctrl+S radiobutton} -body {
423 .m1 entryconfigure 5 -accelerator Ctrl+S
424 lindex [.m1 entryconfigure 5 -accelerator] 4
427 test menu-2.61 {entry configuration options 0 -background #ff0000 tearoff} -body {
428 .m1 entryconfigure 0 -background #ff0000
429 lindex [.m1 entryconfigure 0 -background] 4
432 test menu-2.62 {entry configuration options 1 -background #ff0000 command} -body {
433 .m1 entryconfigure 1 -background #ff0000
434 lindex [.m1 entryconfigure 1 -background] 4
437 test menu-2.63 {entry configuration options 2 -background #ff0000 cascade} -body {
438 .m1 entryconfigure 2 -background #ff0000
439 lindex [.m1 entryconfigure 2 -background] 4
442 test menu-2.64 {entry configuration options 3 -background #ff0000 separator} -body {
443 .m1 entryconfigure 3 -background #ff0000
444 lindex [.m1 entryconfigure 3 -background] 4
447 test menu-2.65 {entry configuration options 4 -background #ff0000 checkbutton} -body {
448 .m1 entryconfigure 4 -background #ff0000
449 lindex [.m1 entryconfigure 4 -background] 4
452 test menu-2.66 {entry configuration options 5 -background #ff0000 radiobutton} -body {
453 .m1 entryconfigure 5 -background #ff0000
454 lindex [.m1 entryconfigure 5 -background] 4
457 test menu-2.67 {entry configuration options 0 -background non-existent tearoff} -body {
458 .m1 entryconfigure 0 -background non-existent
459 } -returnCodes error -result {unknown color name "non-existent"}
461 test menu-2.68 {entry configuration options 1 -background non-existent command} -body {
462 .m1 entryconfigure 1 -background non-existent
463 } -returnCodes error -result {unknown color name "non-existent"}
465 test menu-2.69 {entry configuration options 2 -background non-existent cascade} -body {
466 .m1 entryconfigure 2 -background non-existent
467 } -returnCodes error -result {unknown color name "non-existent"}
469 test menu-2.70 {entry configuration options 3 -background non-existent separator} -body {
470 .m1 entryconfigure 3 -background non-existent
471 } -returnCodes error -result {unknown color name "non-existent"}
473 test menu-2.71 {entry configuration options 4 -background non-existent checkbutton} -body {
474 .m1 entryconfigure 4 -background non-existent
475 } -returnCodes error -result {unknown color name "non-existent"}
477 test menu-2.72 {entry configuration options 5 -background non-existent radiobutton} -body {
478 .m1 entryconfigure 5 -background non-existent
479 } -returnCodes error -result {unknown color name "non-existent"}
481 test menu-2.73 {entry configuration options 0 -bitmap questhead tearoff} -body {
482 .m1 entryconfigure 0 -bitmap questhead
483 } -returnCodes error -result {unknown option "-bitmap"}
485 test menu-2.74 {entry configuration options 1 -bitmap questhead command} -body {
486 .m1 entryconfigure 1 -bitmap questhead
487 lindex [.m1 entryconfigure 1 -bitmap] 4
488 } -result {questhead}
490 test menu-2.75 {entry configuration options 2 -bitmap questhead cascade} -body {
491 .m1 entryconfigure 2 -bitmap questhead
492 lindex [.m1 entryconfigure 2 -bitmap] 4
493 } -result {questhead}
495 test menu-2.76 {entry configuration options 3 -bitmap questhead separator} -body {
496 .m1 entryconfigure 3 -bitmap questhead
497 } -returnCodes error -result {unknown option "-bitmap"}
499 test menu-2.77 {entry configuration options 4 -bitmap questhead checkbutton} -body {
500 .m1 entryconfigure 4 -bitmap questhead
501 lindex [.m1 entryconfigure 4 -bitmap] 4
502 } -result {questhead}
504 test menu-2.78 {entry configuration options 5 -bitmap questhead radiobutton} -body {
505 .m1 entryconfigure 5 -bitmap questhead
506 lindex [.m1 entryconfigure 5 -bitmap] 4
507 } -result {questhead}
509 test menu-2.79 {entry configuration options 0 -bitmap badValue tearoff} -body {
510 .m1 entryconfigure 0 -bitmap badValue
511 } -returnCodes error -result {unknown option "-bitmap"}
513 test menu-2.80 {entry configuration options 1 -bitmap badValue command} -body {
514 .m1 entryconfigure 1 -bitmap badValue
515 } -returnCodes error -result {bitmap "badValue" not defined}
517 test menu-2.81 {entry configuration options 2 -bitmap badValue cascade} -body {
518 .m1 entryconfigure 2 -bitmap badValue
519 } -returnCodes error -result {bitmap "badValue" not defined}
521 test menu-2.82 {entry configuration options 3 -bitmap badValue separator} -body {
522 .m1 entryconfigure 3 -bitmap badValue
523 } -returnCodes error -result {unknown option "-bitmap"}
525 test menu-2.83 {entry configuration options 4 -bitmap badValue checkbutton} -body {
526 .m1 entryconfigure 4 -bitmap badValue
527 } -returnCodes error -result {bitmap "badValue" not defined}
529 test menu-2.84 {entry configuration options 5 -bitmap badValue radiobutton} -body {
530 .m1 entryconfigure 5 -bitmap badValue
531 } -returnCodes error -result {bitmap "badValue" not defined}
533 test menu-2.85 {entry configuration options 0 -columnbreak 1 tearoff} -body {
534 .m1 entryconfigure 0 -columnbreak 1
535 } -returnCodes error -result {unknown option "-columnbreak"}
537 test menu-2.86 {entry configuration options 1 -columnbreak 1 command} -body {
538 .m1 entryconfigure 1 -columnbreak 1
539 lindex [.m1 entryconfigure 1 -columnbreak] 4
542 test menu-2.87 {entry configuration options 2 -columnbreak 1 cascade} -body {
543 .m1 entryconfigure 2 -columnbreak 1
544 lindex [.m1 entryconfigure 2 -columnbreak] 4
547 test menu-2.88 {entry configuration options 3 -columnbreak 1 separator} -body {
548 .m1 entryconfigure 3 -columnbreak 1
549 } -returnCodes error -result {unknown option "-columnbreak"}
551 test menu-2.89 {entry configuration options 4 -columnbreak 1 checkbutton} -body {
552 .m1 entryconfigure 4 -columnbreak 1
553 lindex [.m1 entryconfigure 4 -columnbreak] 4
556 test menu-2.90 {entry configuration options 5 -columnbreak 1 radiobutton} -body {
557 .m1 entryconfigure 5 -columnbreak 1
558 lindex [.m1 entryconfigure 5 -columnbreak] 4
561 test menu-2.91 {entry configuration options 0 -command beep tearoff} -body {
562 .m1 entryconfigure 0 -command beep
563 } -returnCodes error -result {unknown option "-command"}
565 test menu-2.92 {entry configuration options 1 -command beep command} -body {
566 .m1 entryconfigure 1 -command beep
567 lindex [.m1 entryconfigure 1 -command] 4
570 test menu-2.93 {entry configuration options 2 -command beep cascade} -body {
571 .m1 entryconfigure 2 -command beep
572 lindex [.m1 entryconfigure 2 -command] 4
575 test menu-2.94 {entry configuration options 3 -command beep separator} -body {
576 .m1 entryconfigure 3 -command beep
577 } -returnCodes error -result {unknown option "-command"}
579 test menu-2.95 {entry configuration options 4 -command beep checkbutton} -body {
580 .m1 entryconfigure 4 -command beep
581 lindex [.m1 entryconfigure 4 -command] 4
584 test menu-2.96 {entry configuration options 5 -command beep radiobutton} -body {
585 .m1 entryconfigure 5 -command beep
586 lindex [.m1 entryconfigure 5 -command] 4
589 test menu-2.97 {entry configuration options 0 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* tearoff} -body {
590 .m1 entryconfigure 0 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
591 } -returnCodes error -result {unknown option "-font"}
593 test menu-2.98 {entry configuration options 1 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* command} -body {
594 .m1 entryconfigure 1 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
595 lindex [.m1 entryconfigure 1 -font] 4
596 } -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
598 test menu-2.99 {entry configuration options 2 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* cascade} -body {
599 .m1 entryconfigure 2 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
600 lindex [.m1 entryconfigure 2 -font] 4
601 } -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
603 test menu-2.100 {entry configuration options 3 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* separator} -body {
604 .m1 entryconfigure 3 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
605 } -returnCodes error -result {unknown option "-font"}
607 test menu-2.101 {entry configuration options 4 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* checkbutton} -body {
608 .m1 entryconfigure 4 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
609 lindex [.m1 entryconfigure 4 -font] 4
610 } -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
612 test menu-2.102 {entry configuration options 5 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* radiobutton} -body {
613 .m1 entryconfigure 5 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
614 lindex [.m1 entryconfigure 5 -font] 4
615 } -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
617 test menu-2.103 {entry configuration options 0 -font {kill rock stars} tearoff} -body {
618 .m1 entryconfigure 0 -font {kill rock stars}
619 } -returnCodes error -result {unknown option "-font"}
621 test menu-2.104 {entry configuration options 1 -font {kill rock stars} command} -body {
622 .m1 entryconfigure 1 -font {kill rock stars}
623 } -returnCodes error -result {expected integer but got "rock"}
625 test menu-2.105 {entry configuration options 2 -font {kill rock stars} cascade} -body {
626 .m1 entryconfigure 2 -font {kill rock stars}
627 } -returnCodes error -result {expected integer but got "rock"}
629 test menu-2.106 {entry configuration options 3 -font {kill rock stars} separator} -body {
630 .m1 entryconfigure 3 -font {kill rock stars}
631 } -returnCodes error -result {unknown option "-font"}
633 test menu-2.107 {entry configuration options 4 -font {kill rock stars} checkbutton} -body {
634 .m1 entryconfigure 4 -font {kill rock stars}
635 } -returnCodes error -result {expected integer but got "rock"}
637 test menu-2.108 {entry configuration options 5 -font {kill rock stars} radiobutton} -body {
638 .m1 entryconfigure 5 -font {kill rock stars}
639 } -returnCodes error -result {expected integer but got "rock"}
641 test menu-2.109 {entry configuration options 0 -foreground #110022 tearoff} -body {
642 .m1 entryconfigure 0 -foreground #110022
643 } -returnCodes error -result {unknown option "-foreground"}
645 test menu-2.110 {entry configuration options 1 -foreground #110022 command} -body {
646 .m1 entryconfigure 1 -foreground #110022
647 lindex [.m1 entryconfigure 1 -foreground] 4
650 test menu-2.111 {entry configuration options 2 -foreground #110022 cascade} -body {
651 .m1 entryconfigure 2 -foreground #110022
652 lindex [.m1 entryconfigure 2 -foreground] 4
655 test menu-2.112 {entry configuration options 3 -foreground #110022 separator} -body {
656 .m1 entryconfigure 3 -foreground #110022
657 } -returnCodes error -result {unknown option "-foreground"}
659 test menu-2.113 {entry configuration options 4 -foreground #110022 checkbutton} -body {
660 .m1 entryconfigure 4 -foreground #110022
661 lindex [.m1 entryconfigure 4 -foreground] 4
664 test menu-2.114 {entry configuration options 5 -foreground #110022 radiobutton} -body {
665 .m1 entryconfigure 5 -foreground #110022
666 lindex [.m1 entryconfigure 5 -foreground] 4
669 test menu-2.115 {entry configuration options 0 -foreground non-existent tearoff} -body {
670 .m1 entryconfigure 0 -foreground non-existent
671 } -returnCodes error -result {unknown option "-foreground"}
673 test menu-2.116 {entry configuration options 1 -foreground non-existent command} -body {
674 .m1 entryconfigure 1 -foreground non-existent
675 } -returnCodes error -result {unknown color name "non-existent"}
677 test menu-2.117 {entry configuration options 2 -foreground non-existent cascade} -body {
678 .m1 entryconfigure 2 -foreground non-existent
679 } -returnCodes error -result {unknown color name "non-existent"}
681 test menu-2.118 {entry configuration options 3 -foreground non-existent separator} -body {
682 .m1 entryconfigure 3 -foreground non-existent
683 } -returnCodes error -result {unknown option "-foreground"}
685 test menu-2.119 {entry configuration options 4 -foreground non-existent checkbutton} -body {
686 .m1 entryconfigure 4 -foreground non-existent
687 } -returnCodes error -result {unknown color name "non-existent"}
689 test menu-2.120 {entry configuration options 5 -foreground non-existent radiobutton} -body {
690 .m1 entryconfigure 5 -foreground non-existent
691 } -returnCodes error -result {unknown color name "non-existent"}
693 test menu-2.121 {entry configuration options 0 -image image1 tearoff} -constraints {
696 .m1 entryconfigure 0 -image image1
697 } -returnCodes error -result {unknown option "-image"}
699 test menu-2.122 {entry configuration options 1 -image image1 command} -constraints {
702 .m1 entryconfigure 1 -image {}
704 .m1 entryconfigure 1 -image image1
705 lindex [.m1 entryconfigure 1 -image] 4
707 .m1 entryconfigure 1 -image {}
710 test menu-2.123 {entry configuration options 2 -image image1 cascade} -constraints {
713 .m1 entryconfigure 2 -image {}
715 .m1 entryconfigure 2 -image image1
716 lindex [.m1 entryconfigure 2 -image] 4
718 .m1 entryconfigure 2 -image {}
721 test menu-2.124 {entry configuration options 3 -image image1 separator} -constraints {
724 .m1 entryconfigure 3 -image image1
725 } -returnCodes error -result {unknown option "-image"}
727 test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -constraints {
730 .m1 entryconfigure 4 -image {}
732 .m1 entryconfigure 4 -image image1
733 lindex [.m1 entryconfigure 4 -image] 4
735 .m1 entryconfigure 4 -image {}
738 test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -constraints {
741 .m1 entryconfigure 5 -image {}
743 .m1 entryconfigure 5 -image image1
744 lindex [.m1 entryconfigure 5 -image] 4
746 .m1 entryconfigure 5 -image {}
749 test menu-2.127 {entry configuration options 0 -image bogus tearoff} -body {
750 .m1 entryconfigure 0 -image bogus
751 } -returnCodes error -result {unknown option "-image"}
753 test menu-2.128 {entry configuration options 1 -image bogus command} -body {
754 .m1 entryconfigure 1 -image bogus
755 } -returnCodes error -result {image "bogus" doesn't exist}
757 test menu-2.129 {entry configuration options 2 -image bogus cascade} -body {
758 .m1 entryconfigure 2 -image bogus
759 } -returnCodes error -result {image "bogus" doesn't exist}
761 test menu-2.130 {entry configuration options 3 -image bogus separator} -body {
762 .m1 entryconfigure 3 -image bogus
763 } -returnCodes error -result {unknown option "-image"}
765 test menu-2.131 {entry configuration options 4 -image bogus checkbutton} -body {
766 .m1 entryconfigure 4 -image bogus
767 } -returnCodes error -result {image "bogus" doesn't exist}
769 test menu-2.132 {entry configuration options 5 -image bogus radiobutton} -body {
770 .m1 entryconfigure 5 -image bogus
771 } -returnCodes error -result {image "bogus" doesn't exist}
773 test menu-2.133 {entry configuration options 0 -image {} tearoff} -body {
774 .m1 entryconfigure 0 -image
775 } -returnCodes error -result {unknown option "-image"}
777 test menu-2.134 {entry configuration options 1 -image {} command} -setup {
778 .m1 entryconfigure 1 -image {}
780 .m1 entryconfigure 1 -image
781 lindex [.m1 entryconfigure 1 -image] 4
784 test menu-2.135 {entry configuration options 2 -image {} cascade} -setup {
785 .m1 entryconfigure 2 -image {}
787 .m1 entryconfigure 2 -image
788 lindex [.m1 entryconfigure 2 -image] 4
791 test menu-2.136 {entry configuration options 3 -image {} separator} -body {
792 .m1 entryconfigure 3 -image
793 } -returnCodes error -result {unknown option "-image"}
795 test menu-2.137 {entry configuration options 4 -image {} checkbutton} -body {
796 .m1 entryconfigure 4 -image
797 lindex [.m1 entryconfigure 4 -image] 4
800 test menu-2.138 {entry configuration options 5 -image {} radiobutton} -body {
801 .m1 entryconfigure 5 -image
802 lindex [.m1 entryconfigure 5 -image] 4
805 test menu-2.139 {entry configuration options 0 -indicatoron 1 tearoff} -body {
806 .m1 entryconfigure 0 -indicatoron 1
807 } -returnCodes error -result {unknown option "-indicatoron"}
809 test menu-2.140 {entry configuration options 1 -indicatoron 1 command} -body {
810 .m1 entryconfigure 1 -indicatoron 1
811 } -returnCodes error -result {unknown option "-indicatoron"}
813 test menu-2.141 {entry configuration options 2 -indicatoron 1 cascade} -body {
814 .m1 entryconfigure 2 -indicatoron 1
815 } -returnCodes error -result {unknown option "-indicatoron"}
817 test menu-2.142 {entry configuration options 3 -indicatoron 1 separator} -body {
818 .m1 entryconfigure 3 -indicatoron 1
819 } -returnCodes error -result {unknown option "-indicatoron"}
821 test menu-2.143 {entry configuration options 4 -indicatoron 1 checkbutton} -body {
822 .m1 entryconfigure 4 -indicatoron 1
823 lindex [.m1 entryconfigure 4 -indicatoron] 4
826 test menu-2.144 {entry configuration options 5 -indicatoron 1 radiobutton} -body {
827 .m1 entryconfigure 5 -indicatoron 1
828 lindex [.m1 entryconfigure 5 -indicatoron] 4
831 test menu-2.145 {entry configuration options 0 -label test tearoff} -body {
832 .m1 entryconfigure 0 -label test
833 } -returnCodes error -result {unknown option "-label"}
835 test menu-2.146 {entry configuration options 1 -label test command} -body {
836 .m1 entryconfigure 1 -label test
837 lindex [.m1 entryconfigure 1 -label] 4
840 test menu-2.147 {entry configuration options 2 -label test cascade} -body {
841 .m1 entryconfigure 2 -label test
842 lindex [.m1 entryconfigure 2 -label] 4
845 test menu-2.148 {entry configuration options 3 -label test separator} -body {
846 .m1 entryconfigure 3 -label test
847 } -returnCodes error -result {unknown option "-label"}
849 test menu-2.149 {entry configuration options 4 -label test checkbutton} -body {
850 .m1 entryconfigure 4 -label test
851 lindex [.m1 entryconfigure 4 -label] 4
854 test menu-2.150 {entry configuration options 5 -label test radiobutton} -body {
855 .m1 entryconfigure 5 -label test
856 lindex [.m1 entryconfigure 5 -label] 4
859 test menu-2.151 {entry configuration options 0 -menu .m2 tearoff} -body {
860 .m1 entryconfigure 0 -menu .m2
861 } -returnCodes error -result {unknown option "-menu"}
863 test menu-2.152 {entry configuration options 1 -menu .m2 command} -body {
864 .m1 entryconfigure 1 -menu .m2
865 } -returnCodes error -result {unknown option "-menu"}
867 test menu-2.153 {entry configuration options 2 -menu .m2 cascade} -body {
868 .m1 entryconfigure 2 -menu .m2
869 lindex [.m1 entryconfigure 2 -menu] 4
872 test menu-2.154 {entry configuration options 3 -menu .m2 separator} -body {
873 .m1 entryconfigure 3 -menu .m2
874 } -returnCodes error -result {unknown option "-menu"}
876 test menu-2.155 {entry configuration options 4 -menu .m2 checkbutton} -body {
877 .m1 entryconfigure 4 -menu .m2
878 } -returnCodes error -result {unknown option "-menu"}
880 test menu-2.156 {entry configuration options 5 -menu .m2 radiobutton} -body {
881 .m1 entryconfigure 5 -menu .m2
882 } -returnCodes error -result {unknown option "-menu"}
884 test menu-2.157 {entry configuration options 0 -offvalue off tearoff} -body {
885 .m1 entryconfigure 0 -offvalue off
886 } -returnCodes error -result {unknown option "-offvalue"}
888 test menu-2.158 {entry configuration options 1 -offvalue off command} -body {
889 .m1 entryconfigure 1 -offvalue off
890 } -returnCodes error -result {unknown option "-offvalue"}
892 test menu-2.159 {entry configuration options 2 -offvalue off cascade} -body {
893 .m1 entryconfigure 2 -offvalue off
894 } -returnCodes error -result {unknown option "-offvalue"}
896 test menu-2.160 {entry configuration options 3 -offvalue off separator} -body {
897 .m1 entryconfigure 3 -offvalue off
898 } -returnCodes error -result {unknown option "-offvalue"}
900 test menu-2.161 {entry configuration options 4 -offvalue off checkbutton} -body {
901 .m1 entryconfigure 4 -offvalue off
902 lindex [.m1 entryconfigure 4 -offvalue] 4
905 test menu-2.162 {entry configuration options 5 -offvalue off radiobutton} -body {
906 .m1 entryconfigure 5 -offvalue off
907 } -returnCodes error -result {unknown option "-offvalue"}
909 test menu-2.163 {entry configuration options 0 -onvalue on tearoff} -body {
910 .m1 entryconfigure 0 -onvalue on
911 } -returnCodes error -result {unknown option "-onvalue"}
913 test menu-2.164 {entry configuration options 1 -onvalue on command} -body {
914 .m1 entryconfigure 1 -onvalue on
915 } -returnCodes error -result {unknown option "-onvalue"}
917 test menu-2.165 {entry configuration options 2 -onvalue on cascade} -body {
918 .m1 entryconfigure 2 -onvalue on
919 } -returnCodes error -result {unknown option "-onvalue"}
921 test menu-2.166 {entry configuration options 3 -onvalue on separator} -body {
922 .m1 entryconfigure 3 -onvalue on
923 } -returnCodes error -result {unknown option "-onvalue"}
925 test menu-2.167 {entry configuration options 4 -onvalue on checkbutton} -body {
926 .m1 entryconfigure 4 -onvalue on
927 lindex [.m1 entryconfigure 4 -onvalue] 4
930 test menu-2.168 {entry configuration options 5 -onvalue on radiobutton} -body {
931 .m1 entryconfigure 5 -onvalue on
932 } -returnCodes error -result {unknown option "-onvalue"}
934 test menu-2.169 {entry configuration options 0 -selectcolor #110022 tearoff} -body {
935 .m1 entryconfigure 0 -selectcolor #110022
936 } -returnCodes error -result {unknown option "-selectcolor"}
938 test menu-2.170 {entry configuration options 1 -selectcolor #110022 command} -body {
939 .m1 entryconfigure 1 -selectcolor #110022
940 } -returnCodes error -result {unknown option "-selectcolor"}
942 test menu-2.171 {entry configuration options 2 -selectcolor #110022 cascade} -body {
943 .m1 entryconfigure 2 -selectcolor #110022
944 } -returnCodes error -result {unknown option "-selectcolor"}
946 test menu-2.172 {entry configuration options 3 -selectcolor #110022 separator} -body {
947 .m1 entryconfigure 3 -selectcolor #110022
948 } -returnCodes error -result {unknown option "-selectcolor"}
950 test menu-2.173 {entry configuration options 4 -selectcolor #110022 checkbutton} -body {
951 .m1 entryconfigure 4 -selectcolor #110022
952 lindex [.m1 entryconfigure 4 -selectcolor] 4
955 test menu-2.174 {entry configuration options 5 -selectcolor #110022 radiobutton} -body {
956 .m1 entryconfigure 5 -selectcolor #110022
957 lindex [.m1 entryconfigure 5 -selectcolor] 4
960 test menu-2.175 {entry configuration options 0 -selectcolor non-existent tearoff} -body {
961 .m1 entryconfigure 0 -selectcolor non-existent
962 } -returnCodes error -result {unknown option "-selectcolor"}
964 test menu-2.176 {entry configuration options 1 -selectcolor non-existent command} -body {
965 .m1 entryconfigure 1 -selectcolor non-existent
966 } -returnCodes error -result {unknown option "-selectcolor"}
968 test menu-2.177 {entry configuration options 2 -selectcolor non-existent cascade} -body {
969 .m1 entryconfigure 2 -selectcolor non-existent
970 } -returnCodes error -result {unknown option "-selectcolor"}
972 test menu-2.178 {entry configuration options 3 -selectcolor non-existent separator} -body {
973 .m1 entryconfigure 3 -selectcolor non-existent
974 } -returnCodes error -result {unknown option "-selectcolor"}
976 test menu-2.179 {entry configuration options 4 -selectcolor non-existent checkbutton} -body {
977 .m1 entryconfigure 4 -selectcolor non-existent
978 } -returnCodes error -result {unknown color name "non-existent"}
980 test menu-2.180 {entry configuration options 5 -selectcolor non-existent radiobutton} -body {
981 .m1 entryconfigure 5 -selectcolor non-existent
982 } -returnCodes error -result {unknown color name "non-existent"}
984 test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -constraints {
987 .m1 entryconfigure 0 -selectimage image1
988 } -returnCodes error -result {unknown option "-selectimage"}
990 test menu-2.182 {entry configuration options 1 -selectimage image1 command} -constraints {
993 .m1 entryconfigure 1 -selectimage image1
994 } -returnCodes error -result {unknown option "-selectimage"}
996 test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -constraints {
999 .m1 entryconfigure 2 -selectimage image1
1000 } -returnCodes error -result {unknown option "-selectimage"}
1002 test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -constraints {
1005 .m1 entryconfigure 3 -selectimage image1
1006 } -returnCodes error -result {unknown option "-selectimage"}
1008 test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -constraints {
1011 .m1 entryconfigure 4 -selectimage {}
1013 .m1 entryconfigure 4 -selectimage image1
1014 lindex [.m1 entryconfigure 4 -selectimage] 4
1016 .m1 entryconfigure 4 -selectimage {}
1019 test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -constraints {
1022 .m1 entryconfigure 5 -selectimage {}
1024 .m1 entryconfigure 5 -selectimage image1
1025 lindex [.m1 entryconfigure 5 -selectimage] 4
1027 .m1 entryconfigure 5 -selectimage {}
1030 test menu-2.187 {entry configuration options 0 -selectimage bogus tearoff} -body {
1031 .m1 entryconfigure 0 -selectimage bogus
1032 } -returnCodes error -result {unknown option "-selectimage"}
1034 test menu-2.188 {entry configuration options 1 -selectimage bogus command} -body {
1035 .m1 entryconfigure 1 -selectimage bogus
1036 } -returnCodes error -result {unknown option "-selectimage"}
1038 test menu-2.189 {entry configuration options 2 -selectimage bogus cascade} -body {
1039 .m1 entryconfigure 2 -selectimage bogus
1040 } -returnCodes error -result {unknown option "-selectimage"}
1042 test menu-2.190 {entry configuration options 3 -selectimage bogus separator} -body {
1043 .m1 entryconfigure 3 -selectimage bogus
1044 } -returnCodes error -result {unknown option "-selectimage"}
1046 test menu-2.191 {entry configuration options 4 -selectimage bogus checkbutton} -body {
1047 .m1 entryconfigure 4 -selectimage bogus
1048 } -returnCodes error -result {image "bogus" doesn't exist}
1050 test menu-2.192 {entry configuration options 5 -selectimage bogus radiobutton} -body {
1051 .m1 entryconfigure 5 -selectimage bogus
1052 } -returnCodes error -result {image "bogus" doesn't exist}
1054 test menu-2.193 {entry configuration options 0 -selectimage {} tearoff} -body {
1055 .m1 entryconfigure 0 -selectimage
1056 } -returnCodes error -result {unknown option "-selectimage"}
1058 test menu-2.194 {entry configuration options 1 -selectimage {} command} -body {
1059 .m1 entryconfigure 1 -selectimage
1060 } -returnCodes error -result {unknown option "-selectimage"}
1062 test menu-2.195 {entry configuration options 2 -selectimage {} cascade} -body {
1063 .m1 entryconfigure 2 -selectimage
1064 } -returnCodes error -result {unknown option "-selectimage"}
1066 test menu-2.196 {entry configuration options 3 -selectimage {} separator} -body {
1067 .m1 entryconfigure 3 -selectimage
1068 } -returnCodes error -result {unknown option "-selectimage"}
1070 test menu-2.197 {entry configuration options 4 -selectimage {} checkbutton} -body {
1071 .m1 entryconfigure 4 -selectimage
1072 lindex [.m1 entryconfigure 4 -selectimage] 4
1075 test menu-2.198 {entry configuration options 5 -selectimage {} radiobutton} -body {
1076 .m1 entryconfigure 5 -selectimage
1077 lindex [.m1 entryconfigure 5 -selectimage] 4
1080 test menu-2.199 {entry configuration options 0 -state normal tearoff} -body {
1081 .m1 entryconfigure 0 -state normal
1082 lindex [.m1 entryconfigure 0 -state] 4
1085 test menu-2.200 {entry configuration options 1 -state normal command} -body {
1086 .m1 entryconfigure 1 -state normal
1087 lindex [.m1 entryconfigure 1 -state] 4
1090 test menu-2.201 {entry configuration options 2 -state normal cascade} -body {
1091 .m1 entryconfigure 2 -state normal
1092 lindex [.m1 entryconfigure 2 -state] 4
1095 test menu-2.202 {entry configuration options 3 -state normal separator} -body {
1096 .m1 entryconfigure 3 -state normal
1097 } -returnCodes error -result {unknown option "-state"}
1099 test menu-2.203 {entry configuration options 4 -state normal checkbutton} -body {
1100 .m1 entryconfigure 4 -state normal
1101 lindex [.m1 entryconfigure 4 -state] 4
1104 test menu-2.204 {entry configuration options 5 -state normal radiobutton} -body {
1105 .m1 entryconfigure 5 -state normal
1106 lindex [.m1 entryconfigure 5 -state] 4
1109 test menu-2.205 {entry configuration options 0 -value {any string} tearoff} -body {
1110 .m1 entryconfigure 0 -value {any string}
1111 } -returnCodes error -result {unknown option "-value"}
1113 test menu-2.206 {entry configuration options 1 -value {any string} command} -body {
1114 .m1 entryconfigure 1 -value {any string}
1115 } -returnCodes error -result {unknown option "-value"}
1117 test menu-2.207 {entry configuration options 2 -value {any string} cascade} -body {
1118 .m1 entryconfigure 2 -value {any string}
1119 } -returnCodes error -result {unknown option "-value"}
1121 test menu-2.208 {entry configuration options 3 -value {any string} separator} -body {
1122 .m1 entryconfigure 3 -value {any string}
1123 } -returnCodes error -result {unknown option "-value"}
1125 test menu-2.209 {entry configuration options 4 -value {any string} checkbutton} -body {
1126 .m1 entryconfigure 4 -value {any string}
1127 } -returnCodes error -result {unknown option "-value"}
1129 test menu-2.210 {entry configuration options 5 -value {any string} radiobutton} -body {
1130 .m1 entryconfigure 5 -value {any string}
1131 lindex [.m1 entryconfigure 5 -value] 4
1132 } -result {any string}
1134 test menu-2.211 {entry configuration options 0 -variable {any string} tearoff} -body {
1135 .m1 entryconfigure 0 -variable {any string}
1136 } -returnCodes error -result {unknown option "-variable"}
1138 test menu-2.212 {entry configuration options 1 -variable {any string} command} -body {
1139 .m1 entryconfigure 1 -variable {any string}
1140 } -returnCodes error -result {unknown option "-variable"}
1142 test menu-2.213 {entry configuration options 2 -variable {any string} cascade} -body {
1143 .m1 entryconfigure 2 -variable {any string}
1144 } -returnCodes error -result {unknown option "-variable"}
1146 test menu-2.214 {entry configuration options 3 -variable {any string} separator} -body {
1147 .m1 entryconfigure 3 -variable {any string}
1148 } -returnCodes error -result {unknown option "-variable"}
1150 test menu-2.215 {entry configuration options 4 -variable {any string} checkbutton} -body {
1151 .m1 entryconfigure 4 -variable {any string}
1152 lindex [.m1 entryconfigure 4 -variable] 4
1153 } -result {any string}
1155 test menu-2.216 {entry configuration options 5 -variable {any string} radiobutton} -body {
1156 .m1 entryconfigure 5 -variable {any string}
1157 lindex [.m1 entryconfigure 5 -variable] 4
1158 } -result {any string}
1160 test menu-2.217 {entry configuration options 0 -underline 0 tearoff} -body {
1161 .m1 entryconfigure 0 -underline 0
1162 } -returnCodes error -result {unknown option "-underline"}
1164 test menu-2.218 {entry configuration options 1 -underline 0 command} -body {
1165 .m1 entryconfigure 1 -underline 0
1166 lindex [.m1 entryconfigure 1 -underline] 4
1169 test menu-2.219 {entry configuration options 2 -underline 0 cascade} -body {
1170 .m1 entryconfigure 2 -underline 0
1171 lindex [.m1 entryconfigure 2 -underline] 4
1174 test menu-2.220 {entry configuration options 3 -underline 0 separator} -body {
1175 .m1 entryconfigure 3 -underline 0
1176 } -returnCodes error -result {unknown option "-underline"}
1178 test menu-2.221 {entry configuration options 4 -underline 0 checkbutton} -body {
1179 .m1 entryconfigure 4 -underline 0
1180 lindex [.m1 entryconfigure 4 -underline] 4
1183 test menu-2.222 {entry configuration options 5 -underline 0 radiobutton} -body {
1184 .m1 entryconfigure 5 -underline 0
1185 lindex [.m1 entryconfigure 5 -underline] 4
1188 test menu-2.223 {entry configuration options 0 -underline 3p tearoff} -body {
1189 .m1 entryconfigure 0 -underline 3p
1190 } -returnCodes error -result {unknown option "-underline"}
1192 test menu-2.224 {entry configuration options 1 -underline 3p command} -body {
1193 .m1 entryconfigure 1 -underline 3p
1194 } -returnCodes error -result {expected integer but got "3p"}
1196 test menu-2.225 {entry configuration options 2 -underline 3p cascade} -body {
1197 .m1 entryconfigure 2 -underline 3p
1198 } -returnCodes error -result {expected integer but got "3p"}
1200 test menu-2.226 {entry configuration options 3 -underline 3p separator} -body {
1201 .m1 entryconfigure 3 -underline 3p
1202 } -returnCodes error -result {unknown option "-underline"}
1204 test menu-2.227 {entry configuration options 4 -underline 3p checkbutton} -body {
1205 .m1 entryconfigure 4 -underline 3p
1206 } -returnCodes error -result {expected integer but got "3p"}
1208 test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body {
1209 .m1 entryconfigure 5 -underline 3p
1210 } -returnCodes error -result {expected integer but got "3p"}
1213 if {[testConstraint hasEarthPhoto]} {
1219 test menu-3.1 {MenuWidgetCmd procedure} -setup {
1226 } -returnCodes error -result {wrong # args: should be ".m1 option ?arg ...?"}
1227 test menu-3.2 {MenuWidgetCmd, Tcl_Preserve and Tcl_Release} -constraints {
1228 nonUnixUserInteraction
1232 menu .m1 -postcommand "destroy .m1"
1233 .m1 add command -label "menu-3.2: Hit Escape"
1237 } -returnCodes ok -result {}
1238 test menu-3.3 {MenuWidgetCmd procedure, "activate" option} -setup {
1242 .m1 add command -label "test"
1246 } -returnCodes error -result {wrong # args: should be ".m1 activate index"}
1247 test menu-3.4 {MenuWidgetCmd procedure, "activate" option} -setup {
1252 } -returnCodes error -result {bad menu entry index "foo"}
1253 test menu-3.5 {MenuWidgetCmd procedure, "activate" option} -setup {
1257 .m1 add command -label "test"
1263 test menu-3.6 {MenuWidgetCmd procedure, "activate" option} -setup {
1267 .m1 add command -label "test"
1268 .m1 entryconfigure 1 -state disabled
1273 test menu-3.7 {MenuWidgetCmd procedure, "activate" option} -setup {
1277 .m1 add command -label "test"
1282 test menu-3.8 {MenuWidgetCmd procedure, "add" option} -setup {
1289 } -returnCodes error -result {wrong # args: should be ".m1 add type ?-option value ...?"}
1290 test menu-3.9 {MenuWidgetCmd procedure, "add" option} -setup {
1297 } -returnCodes error -result {bad menu entry type "foo": must be cascade, checkbutton, command, radiobutton, or separator}
1298 test menu-3.10 {MenuWidgetCmd procedure, "add" option} -setup {
1306 test menu-3.11 {MenuWidgetCmd procedure, "cget" option} -setup {
1311 } -returnCodes error -result {wrong # args: should be ".m1 cget option"}
1312 test menu-3.12 {MenuWidgetCmd procedure, "cget" option} -setup {
1317 } -returnCodes error -result {unknown option "-gorp"}
1318 test menu-3.13 {MenuWidgetCmd procedure, "cget" option} -setup {
1322 .m1 configure -postcommand "Some string"
1323 .m1 cget -postcommand
1326 } -result {Some string}
1327 test menu-3.14 {MenuWidgetCmd procedure, "clone" option} -setup {
1332 } -returnCodes error -result {wrong # args: should be ".m1 clone newMenuName ?menuType?"}
1333 test menu-3.15 {MenuWidgetCmd procedure, "clone" option} -setup {
1338 } -returnCodes error -result {wrong # args: should be ".m1 clone newMenuName ?menuType?"}
1339 test menu-3.16 {MenuWidgetCmd procedure, "clone" option} -setup {
1343 .m1 clone .m1.clone1
1347 test menu-3.17 {MenuWidgetCmd procedure, "clone" option} -setup {
1351 .m1 clone .m1.clone1 tearoff
1355 test menu-3.18 {MenuWidgetCmd procedure, "configure" option} -setup {
1359 llength [.m1 configure]
1363 test menu-3.19 {MenuWidgetCmd procedure, "configure" option} -setup {
1368 } -returnCodes error -result {unknown option "-gorp"}
1369 test menu-3.20 {MenuWidgetCmd procedure, "configure" option} -setup {
1373 .m1 configure -postcommand "A random String"
1377 test menu-3.21 {MenuWidgetCmd procedure, "configure" option} -setup {
1381 .m1 configure -postcommand "Another string"
1382 lindex [.m1 configure -postcommand] 4
1385 } -result {Another string}
1386 test menu-3.22 {MenuWidgetCmd procedure, "delete" option} -setup {
1391 } -returnCodes error -result {wrong # args: should be ".m1 delete first ?last?"}
1392 test menu-3.23 {MenuWidgetCmd procedure, "delete" option} -setup {
1397 } -returnCodes error -result {bad menu entry index "foo"}
1398 test menu-3.24 {MenuWidgetCmd procedure, "delete" option} -setup {
1403 } -returnCodes error -result {bad menu entry index "foo"}
1404 test menu-3.25 {MenuWidgetCmd procedure, "delete" option} -setup {
1412 test menu-3.26 {MenuWidgetCmd procedure, "delete" option} -setup {
1416 .m1 add command -label "foo"
1421 test menu-3.27 {MenuWidgetCmd procedure, "delete" option} -setup {
1425 .m1 add command -label "1"
1426 .m1 add command -label "2"
1427 .m1 add command -label "3"
1432 test menu-3.28 {MenuWidgetCmd procedure, "delete" option} -setup {
1436 .m1 add command -label "1"
1437 .m1 add command -label "2"
1438 .m1 add command -label "3"
1444 test menu-3.29 {MenuWidgetCmd procedure, "delete" option} -setup {
1448 .m1 add command -label "1"
1449 .m1 add command -label "2"
1450 .m1 add command -label "3"
1456 test menu-3.29+1 {MenuWidgetCmd, "delete", Bug 220950} -setup {
1460 .m1 add command -label "bogus"
1461 .m1 add command -label "ok"
1463 .m1 entrycget last -label
1467 test menu-3.30 {MenuWidgetCmd procedure, "entrycget" option} -setup {
1472 } -returnCodes error -result {wrong # args: should be ".m1 entrycget index option"}
1473 test menu-3.31 {MenuWidgetCmd procedure, "entrycget" option} -setup {
1477 .m1 entrycget index option foo
1478 } -returnCodes error -result {wrong # args: should be ".m1 entrycget index option"}
1479 test menu-3.32 {MenuWidgetCmd procedure, "entrycget" option} -setup {
1483 .m1 entrycget foo -label
1484 } -returnCodes error -result {bad menu entry index "foo"}
1485 test menu-3.33 {MenuWidgetCmd procedure, "entrycget" option} -setup {
1489 .m1 add command -label "test"
1490 .m1 entrycget 1 -label
1494 test menu-3.34 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
1499 } -returnCodes error -result {wrong # args: should be ".m1 entryconfigure index ?-option value ...?"}
1500 test menu-3.35 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
1504 .m1 entryconfigure foo
1505 } -returnCodes error -result {bad menu entry index "foo"}
1506 test menu-3.36 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
1510 .m1 add command -label "test"
1511 llength [.m1 entryconfigure 1]
1515 test menu-3.37 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
1519 .m1 add command -label "test"
1520 lindex [.m1 entryconfigure 1 -label] 4
1524 test menu-3.38 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
1528 .m1 add command -label "test"
1529 .m1 entryconfigure 1 -label "changed"
1530 lindex [.m1 entryconfigure 1 -label] 4
1534 test menu-3.39 {MenuWidgetCmd procedure, "index" option} -setup {
1539 } -returnCodes error -result {wrong # args: should be ".m1 index string"}
1540 test menu-3.40 {MenuWidgetCmd procedure, "index" option} -setup {
1545 } -returnCodes error -result {bad menu entry index "foo"}
1546 test menu-3.41 {MenuWidgetCmd procedure, "index" option} -setup {
1550 .m1 add command -label "test"
1551 .m1 add command -label "3"
1552 .m1 add command -label "another label"
1553 .m1 add command -label "end"
1554 .m1 add command -label "3a"
1555 .m1 add command -label "final entry"
1556 list [.m1 index "test"] [.m1 index "3"] [.m1 index "3a"] [.m1 index "end"]
1560 test menu-3.42 {MenuWidgetCmd procedure, "insert" option} -setup {
1565 } -returnCodes error -result {wrong # args: should be ".m1 insert index type ?-option value ...?"}
1566 test menu-3.43 {MenuWidgetCmd procedure, "insert" option} -setup {
1570 .m1 insert 1 command -label "test"
1571 .m1 entrycget 1 -label
1575 test menu-3.44 {MenuWidgetCmd procedure, "invoke" option} -setup {
1582 } -returnCodes error -result {wrong # args: should be ".m1 invoke index"}
1583 test menu-3.45 {MenuWidgetCmd procedure, "invoke" option} -setup {
1590 } -returnCodes error -result {bad menu entry index "foo"}
1591 test menu-3.46 {MenuWidgetCmd procedure, "invoke" option} -setup {
1596 .m1 add command -label "set foo" -command "set foo hello"
1597 list [.m1 invoke 1] [set foo] [unset foo]
1600 } -returnCodes ok -result {hello hello {}}
1601 test menu-3.47 {MenuWidgetCmd procedure, "post" option} -setup {
1605 .m1 add command -label "On Windows, hit Escape to get this menu to go away"
1609 } -returnCodes error -result {wrong # args: should be ".m1 post x y ?index?"}
1610 test menu-3.48 {MenuWidgetCmd procedure, "post" option} -setup {
1617 } -returnCodes error -result {expected integer but got "foo"}
1618 test menu-3.49 {MenuWidgetCmd procedure, "post" option} -setup {
1625 } -returnCodes error -result {expected integer but got "bar"}
1626 test menu-3.50 {MenuWidgetCmd procedure, "post" option} -constraints {
1627 nonUnixUserInteraction
1632 .m1 add command -label "menu-3.50: hit Escape" -command "puts hello"
1637 test menu-3.51 {MenuWidgetCmd procedure, "postcascade" option} -setup {
1644 } -returnCodes error -result {wrong # args: should be ".m1 postcascade index"}
1645 test menu-3.52 {MenuWidgetCmd procedure, "postcascade" option} -setup {
1652 } -returnCodes error -result {bad menu entry index "foo"}
1653 test menu-3.53 {MenuWidgetCmd procedure, "postcascade" option} -constraints {
1654 nonUnixUserInteraction
1659 .m1 add command -label "menu-3.53 - hit Escape"
1662 .m1 add cascade -menu .m2
1667 test menu-3.54 {MenuWidgetCmd procedure, "postcascade" option} -setup {
1672 .m1 add cascade -menu .m2 -label "menu-3.57 - hit Escape"
1674 .m1 postcascade none
1678 test menu-3.55 {MenuWidgetCmd procedure, "type" option} -setup {
1685 } -returnCodes error -result {wrong # args: should be ".m1 type index"}
1686 test menu-3.56 {MenuWidgetCmd procedure, "type" option} -setup {
1693 } -returnCodes error -result {bad menu entry index "foo"}
1694 test menu-3.57 {MenuWidgetCmd procedure, "type" option} -setup {
1698 .m1 add command -label "test"
1703 test menu-3.58 {MenuWidgetCmd procedure, "type" option} -setup {
1711 } -result {separator}
1712 test menu-3.59 {MenuWidgetCmd procedure, "type" option} -setup {
1716 .m1 add checkbutton -label "test"
1720 } -result {checkbutton}
1721 test menu-3.60 {MenuWidgetCmd procedure, "type" option} -setup {
1725 .m1 add radiobutton -label "test"
1729 } -result {radiobutton}
1730 test menu-3.61 {MenuWidgetCmd procedure, "type" option} -setup {
1734 .m1 add cascade -label "test"
1739 test menu-3.62 {MenuWidgetCmd procedure, "type" option} -setup {
1747 test menu-3.63 {MenuWidgetCmd procedure, "unpost" option} -setup {
1754 } -returnCodes error -result {wrong # args: should be ".m1 unpost"}
1755 test menu-3.64 {MenuWidgetCmd procedure, "unpost" option} -constraints {
1756 nonUnixUserInteraction
1761 .m1 add command -label "menu-3.64 - hit Escape"
1767 test menu-3.65 {MenuWidgetCmd procedure, "yposition" option} -setup {
1774 } -returnCodes error -result {wrong # args: should be ".m1 yposition index"}
1775 test menu-3.66a {MenuWidgetCmd procedure, "yposition" option, no tearoff} -setup {
1783 test menu-3.66b {MenuWidgetCmd procedure, "yposition" option, with tearoff} -constraints {
1788 # on Win or Linux, tearoff menus are supported
1789 # see menu-3.66c for aqua
1795 test menu-3.66c {MenuWidgetCmd procedure, "yposition" option, with tearoff} -constraints {
1800 # on OS X, tearoff menus are not supported
1801 # see menu-3.66b for win or linux
1807 test menu-3.67 {MenuWidgetCmd procedure, bad option} -setup {
1814 } -returnCodes error -result {bad option "foo": must be activate, add, cget, clone, configure, delete, entrycget, entryconfigure, index, insert, invoke, post, postcascade, type, unpost, xposition, or yposition}
1815 test menu-3.68 {MenuWidgetCmd procedure, fix for bug#508988} -setup {
1825 $c1 add command -label c1
1827 $c2 add command -label c2
1828 $m1 add cascade -label c1 -menu $c1
1829 $t configure -menu $m1
1830 $m1 entryconfigure 1 -menu $c2 -label c2
1831 $t configure -menu ""
1832 list [winfo exists $c1] [winfo exists $c2]
1836 test menu-3.69 {MenuWidgetCmd procedure, "xposition" option} -setup {
1843 } -returnCodes error -result {wrong # args: should be ".m1 xposition index"}
1844 test menu-3.70 {MenuWidgetCmd procedure, "xposition" option} -setup {
1849 subst {} ;# just checking that the xposition does not produce an error...
1855 test menu-4.1 {TkInvokeMenu: disabled} -setup {
1860 .m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off \
1862 list [catch {.m1 invoke 1} msg] $foo
1866 test menu-4.2 {TkInvokeMenu: tearoff} -setup {
1870 catch {.m1 invoke 0}
1874 test menu-4.3 {TkInvokeMenu: checkbutton -on} -setup {
1879 .m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off
1880 list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 \
1881 [catch {unset foo} msg3] $msg3
1884 } -result {0 {} 0 on 0 {}}
1885 test menu-4.4 {TkInvokeMenu: checkbutton -off} -setup {
1890 .m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off
1892 list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
1895 } -result {0 {} 0 off 0 {}}
1896 test menu-4.5 {TkInvokeMenu: checkbutton array element} -setup {
1901 .m1 add checkbutton -label "test" -variable foo(1) -onvalue on
1902 list [catch {.m1 invoke 1} msg] $msg [catch {set foo(1)} msg2] $msg2 [catch {unset foo} msg3] $msg3
1905 } -result {0 {} 0 on 0 {}}
1906 test menu-4.6 {TkInvokeMenu: radiobutton} -setup {
1911 .m1 add radiobutton -label "1" -variable foo -value one
1912 .m1 add radiobutton -label "2" -variable foo -value two
1913 .m1 add radiobutton -label "3" -variable foo -value three
1914 list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
1917 } -result {0 {} 0 one 0 {}}
1918 test menu-4.7 {TkInvokeMenu: radiobutton} -setup {
1923 .m1 add radiobutton -label "1" -variable foo -value one
1924 .m1 add radiobutton -label "2" -variable foo -value two
1925 .m1 add radiobutton -label "3" -variable foo -value three
1926 list [catch {.m1 invoke 2} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
1929 } -result {0 {} 0 two 0 {}}
1930 test menu-4.8 {TkInvokeMenu: radiobutton} -setup {
1935 .m1 add radiobutton -label "1" -variable foo -value one
1936 .m1 add radiobutton -label "2" -variable foo -value two
1937 .m1 add radiobutton -label "3" -variable foo -value three
1938 list [catch {.m1 invoke 3} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
1941 } -result {0 {} 0 three 0 {}}
1942 test menu-4.9 {TkInvokeMenu: radiobutton array element} -setup {
1947 .m1 add radiobutton -label "1" -variable foo(2) -value one
1948 .m1 add radiobutton -label "2" -variable foo(2) -value two
1949 .m1 add radiobutton -label "3" -variable foo(2) -value three
1950 list [catch {.m1 invoke 3} msg] $msg [catch {set foo(2)} msg2] $msg2 [catch {unset foo} msg3] $msg3
1953 } -result {0 {} 0 three 0 {}}
1954 test menu-4.10 {TkInvokeMenu} -setup {
1959 .m1 add command -label "test" -command "set menu_test menu-4.8"
1960 list [catch {.m1 invoke 1} msg] $msg [catch {set menu_test} msg2] $msg2 [catch {unset menu_test} msg3] $msg3
1963 } -result {0 menu-4.8 0 menu-4.8 0 {}}
1964 test menu-4.11 {TkInvokeMenu} -setup {
1968 .m1 add cascade -label "test" -menu .m1.m2
1969 list [catch {.m1 invoke 1} msg] $msg
1973 test menu-4.12 {TkInvokeMenu} -setup {
1977 .m1 add command -label "test" -command ".m1 delete 1"
1978 list [catch {.m1 invoke 1} msg] $msg [catch {.m1 type "test"} msg2] $msg2
1981 } -result {0 {} 1 {bad menu entry index "test"}}
1983 test menu-5.1 {DestroyMenuInstance} -setup {
1989 test menu-5.2 {DestroyMenuInstance - cascade menu} -setup {
1993 .m1 add cascade -menu .m2
1997 test menu-5.3 {DestroyMenuInstance - multiple cascade parents} -setup {
2001 .m1 add cascade -menu .m3
2003 .m2 add cascade -menu .m3
2005 list [destroy .m3] [destroy .m1 .m2]
2006 } -returnCodes ok -result {{} {}}
2007 test menu-5.4 {DestroyMenuInstance - multiple cascade parents} -setup {
2008 destroy .m1 .m2 .m3 .m4
2011 .m1 add cascade -menu .m4
2013 .m2 add cascade -menu .m4
2015 .m3 add cascade -menu .m4
2017 list [destroy .m4] [destroy .m1 .m2 .m3]
2018 } -returnCodes ok -result {{} {}}
2019 test menu-5.5 {DestroyMenuInstance - cascades of cloned menus} -setup {
2024 .m1 add cascade -menu .m2
2025 . configure -menu .m1
2026 list [destroy .m2] [.m1 entrycget 1 -menu] [. configure -menu ""] [destroy .m1]
2027 } -returnCodes ok -result {{} .m2 {} {}}
2028 test menu-5.6 {DestroyMenuInstance - cascades of cloned menus} -setup {
2032 .m1 add cascade -menu .m2
2034 . configure -menu .m1
2036 wm geometry .t2 +0+0
2037 .t2 configure -menu .m1
2038 list [destroy .m2] [. configure -menu ""] [destroy .t2 .m1]
2039 } -returnCodes ok -result {{} {} {}}
2040 test menu-5.7 {DestroyMenuInstance - basic clones} -setup {
2044 set tearoff [tk::TearOffMenu .m1]
2045 list [destroy $tearoff] [destroy .m1]
2047 test menu-5.8 {DestroyMenuInstance - multiple clones} -setup {
2051 set tearoff1 [tk::TearOffMenu .m1]
2052 set tearoff2 [tk::TearOffMenu .m1]
2053 list [destroy $tearoff1] [destroy .m1]
2054 } -returnCodes ok -result {{} {}}
2055 test menu-5.9 {DestroyMenuInstace - main menu} -setup {
2062 test menu-5.10 {DestroyMenuInstance - freeing entries} -setup {
2066 .m1 add command -label "foo"
2069 test menu-5.11 {DestroyMenuInstace - no entries} -setup {
2073 .m1 configure -tearoff 0
2076 test menu-5.12 {DestroyMenuInstance - platform data} -setup {
2082 test menu-5.13 {DestroyMenuInstance - clones when mismatched tearoffs} -setup {
2087 .m1 add cascade -menu .m2
2088 set tearoff [tk::TearOffMenu .m1 40 40]
2089 list [destroy .m2] [destroy .m1]
2093 test menu-6.1 {TkDestroyMenu} -setup {
2099 test menu-6.2 {TkDestroyMenu - reentrancy} -setup {
2103 bind .m1 <Destroy> {destroy .m1}
2105 bind .m2 <Destroy> {destroy .m2}
2106 list [destroy .m1] [destroy .m2]
2107 } -returnCodes ok -result {{} {}}
2108 test menu-6.3 {TkDestroyMenu - reentrancy} -setup {
2112 bind .m1 <Destroy> {destroy .m2}
2115 list [destroy .m1] [winfo exists .m2]
2116 } -returnCodes ok -result {{} 0}
2117 test menu-6.4 {TkDestroyMenu - reentrancy - clones} -setup {
2127 test menu-6.5 {TkDestroyMenu} -setup {
2135 test menu-6.6 {TkDestroyMenu} -setup {
2139 .m1 clone .m2 tearoff
2142 test menu-6.7 {TkDestroyMenu} -setup {
2149 } -returnCodes ok -result {}
2150 test menu-6.8 {TkDestroyMenu} -setup {
2157 list [winfo exists .m2] [winfo exists .m3]
2159 test menu-6.9 {TkDestroyMenu} -setup {
2165 list [destroy .m2] [destroy .m3] [destroy .m1]
2166 } -returnCodes ok -result {{} {} {}}
2167 test menu-6.10 {TkDestroyMenu} -setup {
2173 list [destroy .m3] [destroy .m1]
2174 } -returnCodes ok -result {{} {}}
2175 test menu-6.11 {TkDestroyMenu} -setup {
2182 list [destroy .m2] [destroy .m1]
2183 } -returnCodes ok -result {{} {}}
2184 test menu-6.12 {TkDestroyMenu} -setup {
2191 list [destroy .m3] [destroy .m1]
2192 } -returnCodes ok -result {{} {}}
2193 test menu-6.13 {TkDestroyMenu} -setup {
2200 list [destroy .m4] [destroy .m1]
2201 } -returnCodes ok -result {{} {}}
2202 test menu-6.14 {TkDestroyMenu} -setup {
2206 . configure -menu .m1
2207 list [destroy .m1] [. configure -menu ""]
2208 } -returnCodes ok -result {{} {}}
2209 test menu-6.15 {TkDestroyMenu} -setup {
2214 wm geometry .t2 +0+0
2215 . configure -menu .m1
2216 .t2 configure -menu .m1
2217 list [destroy .m1] [destroy .t2] [. configure -menu ""]
2218 } -result {{} {} {}}
2219 test menu-6.16 {TkDestroyMenu} -setup {
2224 wm geometry .t2 +0+0
2226 wm geometry .t3 +0+0
2227 . configure -menu .m1
2228 .t2 configure -menu .m1
2229 .t3 configure -menu .m1
2230 list [destroy .m1] [destroy .t2] [destroy .t3] [. configure -menu ""]
2231 } -result {{} {} {} {}}
2233 test menu-7.1 {UnhookCascadeEntry} -setup {
2237 .m1 add command -label "test"
2240 test menu-7.2 {UnhookCascadeEntry} -setup {
2244 .m1 add cascade -menu .m2
2247 test menu-7.3 {UnhookCascadeEntry} -setup {
2252 .m2 add cascade -menu .cascade
2253 .m1 add cascade -menu .cascade
2254 list [destroy .m1] [destroy .m2]
2255 } -returnCodes ok -result {{} {}}
2256 test menu-7.4 {UnhookCascadeEntry} -setup {
2261 .m1 add cascade -menu .cascade
2262 .m2 add cascade -menu .cascade
2263 list [destroy .m1] [destroy .m2]
2264 } -returnCodes ok -result {{} {}}
2265 test menu-7.5 {UnhookCascadeEntry} -setup {
2271 .m1 add cascade -menu .cascade
2272 .m2 add cascade -menu .cascade
2273 .m3 add cascade -menu .cascade
2274 list [destroy .m1] [destroy .m2 .m3]
2275 } -returnCodes ok -result {{} {}}
2276 test menu-7.6 {UnhookCascadeEntry} -setup {
2282 .m1 add cascade -menu .cascade
2283 .m2 add cascade -menu .cascade
2284 .m3 add cascade -menu .cascade
2285 list [destroy .m2] [destroy .m1 .m3]
2286 } -returnCodes ok -result {{} {}}
2287 test menu-7.7 {UnhookCascadeEntry} -setup {
2293 .m1 add cascade -menu .cascade
2294 .m2 add cascade -menu .cascade
2295 .m3 add cascade -menu .cascade
2296 list [destroy .m3] [destroy .m1 .m2]
2297 } -returnCodes ok -result {{} {}}
2298 test menu-7.8 {UnhookCascadeEntry} -setup {
2303 .m1 add cascade -menu .m2
2304 list [destroy .m1] [destroy .m2]
2305 } -returnCodes ok -result {{} {}}
2306 test menu-7.9 {UnhookCascadeEntry} -setup {
2311 .m1 add cascade -menu .m2
2316 test menu-8.1 {DestroyMenuEntry} -setup {
2321 .m1 add cascade -menu .m2
2322 list [.m1 delete 1] [destroy .m1 .m2]
2324 test menu-8.2 {DestroyMenuEntry} -constraints hasEarthPhoto -setup {
2326 catch {image delete image1a}
2328 image create photo image1a -file $earthPhotoFile
2330 .m1 add command -image image1a
2331 list [.m1 delete 1] [destroy .m1] [image delete image1a]
2332 } -result {{} {} {}}
2333 test menu-8.3 {DestroyMenuEntry} -constraints testImageType -setup {
2337 image create test image1
2338 image create test image2
2340 .m1 add checkbutton -image image1 -selectimage image2
2342 list [.m1 delete 1] [destroy .m1]
2347 test menu-8.4 {DestroyMenuEntry} -setup {
2351 .m1 add checkbutton -variable foo
2352 list [.m1 delete 1] [destroy .m1]
2354 test menu-8.5 {DestroyMenuEntry} -setup {
2358 .m1 add command -label "test"
2359 list [.m1 delete 1] [destroy .m1]
2361 test menu-8.6 {DestroyMenuEntry} -setup {
2365 .m1 add command -label "one"
2366 .m1 add command -label "two"
2367 list [.m1 delete 1] [.m1 entrycget 1 -label] [destroy .m1]
2368 } -result {{} two {}}
2369 test menu-8.7 {DestroyMenuEntry} -setup {
2373 .m1 add command -label "one"
2374 .m1 clone .m2 tearoff
2375 list [.m2 delete 1] [destroy .m1]
2379 # test menu-9 - Can only change when fonts change on system, which cannot
2381 test menu-9.1 {ConfigureMenu} -setup {
2385 list [.m1 configure -postcommand "beep"] [.m1 cget -postcommand]
2389 test menu-9.2 {ConfigureMenu} -setup {
2393 .m1 add command -label "test"
2394 list [.m1 configure -tearoff 0] [.m1 entrycget 1 -label]
2398 test menu-9.3 {ConfigureMenu} -setup {
2402 list [.m1 configure -postcommand "beep"] [.m1 cget -postcommand]
2406 test menu-9.4 {ConfigureMenu} -setup {
2410 .m1 add command -label "test"
2411 .m1 configure -fg red
2415 test menu-9.5 {ConfigureMenu} -setup {
2419 .m1 add command -label "test"
2420 .m1 add command -label "two"
2421 .m1 configure -fg red
2425 test menu-9.6 {ConfigureMenu} -setup {
2429 .m1 add command -label "test"
2430 .m1 add command -label "two"
2431 .m1 add command -label "three"
2432 .m1 configure -fg red
2436 test menu-9.7 {ConfigureMenu} -setup {
2440 .m1 clone .m2 tearoff
2441 list [.m1 configure -fg red] [.m2 cget -fg]
2445 test menu-9.8 {ConfigureMenu} -setup {
2449 .m1 clone .m2 tearoff
2450 list [.m2 configure -fg red] [.m1 cget -fg]
2454 test menu-9.9 {ConfigureMenu} -setup {
2458 list [. configure -menu .m1] [. configure -menu ""]
2464 test menu-10.1 {PostProcessEntry: array variable} -setup {
2470 .m1 add checkbutton -variable foo(1) -onvalue on -offvalue off -label "Nonsense"
2475 test menu-10.2 {PostProcessEntry: array variable} -setup {
2480 .m1 add checkbutton -variable foo(1) -onvalue on -offvalue off -label "Nonsense"
2487 test menu-11.1 {ConfigureMenuEntry} -setup {
2492 .m1 add checkbutton -variable foo -onvalue on -offvalue off -label "Nonsense"
2493 list [.m1 entryconfigure 1 -variable bar] [.m1 entrycget 1 -variable]
2497 test menu-11.2 {ConfigureMenuEntry} -setup {
2501 .m1 add command -label "test"
2502 list [.m1 entryconfigure 1 -label ""] [.m1 entrycget 1 -label]
2506 test menu-11.3 {ConfigureMenuEntry} -setup {
2511 list [.m1 entryconfigure 1 -label "test"] [.m1 entrycget 1 -label]
2515 test menu-11.4 {ConfigureMenuEntry} -setup {
2520 list [.m1 entryconfigure 1 -accel "S"] [.m1 entrycget 1 -accel]
2524 test menu-11.5 {ConfigureMenuEntry} -setup {
2529 list [.m1 entryconfigure 1 -label "test"] [.m1 entrycget 1 -label]
2533 test menu-11.6 {ConfigureMenuEntry} -setup {
2538 .m1 entryconfigure 1 -label "test"
2542 test menu-11.7 {ConfigureMenuEntry} -setup {
2548 .m1 entryconfigure 1 -label "test" -menu .m2
2552 test menu-11.8 {ConfigureMenuEntry} -setup {
2557 .m1 entryconfigure 1 -label "test" -menu .m2
2561 test menu-11.9 {ConfigureMenuEntry} -setup {
2565 .m1 add cascade -menu .m3
2566 .m1 entryconfigure 1 -label "test" -menu .m2
2570 test menu-11.10 {ConfigureMenuEntry} -setup {
2575 .m1 entryconfigure 1 -label "test" -menu .m2
2579 test menu-11.11 {ConfigureMenuEntry} -setup {
2583 .m1 add cascade -menu .m2
2584 .m1 entryconfigure 1 -label "test" -menu .m2
2588 test menu-11.12 {ConfigureMenuEntry} -setup {
2593 .m2 add cascade -menu .m1
2595 .m3 add cascade -menu .m1
2597 .m4 add cascade -menu .m1
2600 .m5 entryconfigure 1 -label "test" -menu .m1
2604 test menu-11.13 {ConfigureMenuEntry} -setup {
2609 .m2 add cascade -menu .m1
2611 .m3 add cascade -menu .m1
2613 .m4 add cascade -menu .m1
2614 .m3 entryconfigure 1 -label "test" -menu .m1
2618 test menu-11.14 {ConfigureMenuEntry} -setup {
2623 list [.m1 entryconfigure 1 -variable "test"] [.m1 entrycget 1 -variable]
2627 test menu-11.15 {ConfigureMenuEntry} -setup {
2631 list [.m1 add checkbutton -label "test"] [.m1 entrycget 1 -variable]
2635 test menu-11.16 {ConfigureMenuEntry} -setup {
2639 .m1 add radiobutton -label "test"
2643 test menu-11.17 {ConfigureMenuEntry} -setup {
2648 list [.m1 entryconfigure 1 -onvalue "test"] [.m1 entrycget 1 -onvalue]
2652 test menu-11.18 {ConfigureMenuEntry} -constraints testImageType -setup {
2658 image create test image1
2659 .m1 entryconfigure 1 -image image1
2664 test menu-11.19 {ConfigureMenuEntry} -constraints {
2665 testImageType hasEarthPhoto
2670 image create test image1
2671 image create photo image2 -file $earthPhotoFile
2673 .m1 add command -image image1
2674 .m1 entryconfigure 1 -image image2
2679 test menu-11.20 {ConfigureMenuEntry} -constraints {
2680 testImageType hasEarthPhoto
2685 image create photo image1 -file $earthPhotoFile
2686 image create test image2
2688 .m1 add checkbutton -image image1
2689 .m1 entryconfigure 1 -selectimage image2
2694 test menu-11.21 {ConfigureMenuEntry} -constraints {
2695 testImageType hasEarthPhoto
2700 image create photo image1 -file $earthPhotoFile
2701 image create test image2
2702 image create test image3
2704 .m1 add checkbutton -image image1 -selectimage image2
2705 .m1 entryconfigure 1 -selectimage image3
2712 test menu-12.1 {ConfigureMenuCloneEntries} -setup {
2717 .m2 configure -tearoff 0
2719 .m1 add command -label "test"
2720 .m1 add command -label "test2"
2721 .m1 entryconfigure 1 -gork "foo"
2724 } -returnCodes error -result {unknown option "-gork"}
2725 test menu-12.2 {ConfigureMenuCloneEntries} -setup {
2731 .m1 add cascade -menu .m3
2733 .m1 entryconfigure 1 -menu .m4
2737 test menu-12.3 {ConfigureMenuCloneEntries} -setup {
2742 .m1 add cascade -label dummy
2743 .m1 entryconfigure dummy -menu .m3
2747 test menu-12.4 {ConfigureMenuCloneEntries} -setup {
2751 .m1 add cascade -label File -menu .m1.foo
2753 .m1.foo add command -label bar
2755 .m1 entryconfigure File -state disabled
2761 test menu-13.1 {TkGetMenuIndex} -setup {
2765 .m1 add command -label "active"
2766 .m1 add command -label "test2"
2767 .m1 add command -label "test3"
2769 .m1 entrycget active -label
2773 test menu-13.2 {TkGetMenuIndex} -setup {
2777 .m1 add command -label "last"
2778 .m1 add command -label "test2"
2779 .m1 add command -label "test3"
2781 .m1 entrycget last -label
2785 test menu-13.3 {TkGetMenuIndex} -setup {
2789 .m1 add command -label "last"
2790 .m1 add command -label "test2"
2791 .m1 add command -label "test3"
2793 .m1 entrycget end -label
2797 test menu-13.4 {TkGetMenuIndex} -setup {
2801 .m1 add command -label "test"
2802 list [.m1 insert last command -label "test2"] [.m1 entrycget last -label]
2805 } -result {{} test2}
2806 test menu-13.5 {TkGetMenuIndex} -setup {
2810 .m1 add command -label "test"
2811 list [.m1 insert end command -label "test2"] [.m1 entrycget end -label]
2814 } -result {{} test2}
2815 test menu-13.6 {TkGetMenuIndex} -setup {
2819 .m1 add command -label "active"
2820 .m1 add command -label "test2"
2821 .m1 add command -label "test3"
2823 .m1 entrycget none -label
2827 #test menu-13.7 - Need to add @test here.
2828 test menu-13.7 {TkGetMenuIndex} -setup {
2832 .m1 add command -label "active"
2833 .m1 add command -label "test2"
2834 .m1 add command -label "test3"
2835 .m1 entrycget 1 -label
2839 test menu-13.8 {TkGetMenuIndex} -setup {
2843 .m1 add command -label "active"
2844 .m1 entrycget -1 -label
2845 } -returnCodes error -result {bad menu entry index "-1"}
2846 test menu-13.9 {TkGetMenuIndex} -setup {
2850 .m1 add command -label "test"
2851 .m1 add command -label "test2"
2852 .m1 entrycget 999 -label
2856 test menu-13.10 {TkGetMenuIndex} -setup {
2860 .m1 insert 999 command -label "test"
2861 .m1 entrycget 1 -label
2865 test menu-13.11 {TkGetMenuIndex} -setup {
2869 .m1 add command -label "1test"
2870 .m1 entrycget 1test -label
2874 test menu-13.12 {TkGetMenuIndex} -setup {
2878 .m1 add command -label "test"
2879 .m1 add command -label "test2" -command "beep"
2880 .m1 add command -label "test3"
2881 .m1 entrycget test2 -command
2886 test menu-14.1 {MenuCmdDeletedProc} -setup {
2894 test menu-14.2 {MenuCmdDeletedProc} -setup {
2904 test menu-15.1 {MenuNewEntry} -setup {
2908 .m1 add command -label "test"
2912 test menu-15.2 {MenuNewEntry} -setup {
2916 .m1 add command -label "test"
2917 .m1 add command -label "test3"
2918 .m1 insert 2 command -label "test2"
2922 test menu-15.3 {MenuNewEntry} -setup {
2926 .m1 add command -label "test"
2927 .m1 add command -label "test2"
2931 test menu-15.4 {MenuNewEntry} -setup {
2935 .m1 add command -label "test"
2940 test menu-16.1 {MenuAddOrInsert} -setup {
2944 .m1 insert foo command -label "test"
2945 } -returnCodes error -result {bad menu entry index "foo"}
2946 test menu-16.2 {MenuAddOrInsert} -setup {
2950 .m1 add command -label "test"
2951 .m1 insert test command -label "foo"
2955 test menu-16.3 {MenuAddOrInsert} -setup {
2959 .m1 insert -1 command -label "test"
2960 } -returnCodes error -result {bad menu entry index "-1"}
2961 test menu-16.4 {MenuAddOrInsert} -setup {
2965 .m1 add command -label "test"
2966 .m1 insert 0 command -label "test2"
2967 .m1 entrycget 1 -label
2971 test menu-16.5 {MenuAddOrInsert} -setup {
2979 test menu-16.6 {MenuAddOrInsert} -setup {
2987 test menu-16.7 {MenuAddOrInsert} -setup {
2995 test menu-16.8 {MenuAddOrInsert} -setup {
3003 test menu-16.9 {MenuAddOrInsert} -setup {
3011 test menu-16.10 {MenuAddOrInsert} -setup {
3016 } -returnCodes error -result {bad menu entry type "blork": must be cascade, checkbutton, command, radiobutton, or separator}
3017 test menu-16.11 {MenuAddOrInsert} -setup {
3025 test menu-16.12 {MenuAddOrInsert} -setup {
3031 list [.m2 add command -label "test"] [.m1 entrycget 1 -label] [.m3 entrycget 1 -label]
3034 } -result {{} test test}
3035 test menu-16.13 {MenuAddOrInsert} -setup {
3041 list [.m3 add command -label "test"] [.m1 entrycget 1 -label] [.m2 entrycget 1 -label]
3044 } -result {{} test test}
3045 test menu-16.14 {MenuAddOrInsert} -setup {
3049 .m1 add command -blork
3050 } -returnCodes error -result {unknown option "-blork"}
3051 test menu-16.15 {MenuAddOrInsert} -setup {
3055 .m1 add command -label "File"
3057 . configure -menu .container
3058 list [.container add cascade -label "File" -menu .m1] [. configure -menu ""]
3062 test menu-16.16 {MenuAddOrInsert} -setup {
3067 set tearoff [tk::TearOffMenu .m2]
3068 list [.m2 add cascade -menu .m1] [$tearoff unpost]
3072 test menu-16.17 {MenuAddOrInsert} -setup {
3077 . configure -menu .container
3078 set tearoff [tk::TearOffMenu .container]
3079 list [.container add cascade -label "File" -menu .m1] [. configure -menu ""]
3083 test menu-16.18 {MenuAddOrInsert} -setup {
3088 .container add cascade -menu .m1
3089 . configure -menu .container
3090 list [.container add cascade -label "File" -menu .m1] [. configure -menu ""]
3094 test menu-16.19 {MenuAddOrInsert - Insert a cascade deep into the tree} -setup {
3098 menu .menubar.test -tearoff 0
3099 .menubar add cascade -label Test -underline 0 -menu .menubar.test
3100 menu .menubar.test.cascade -tearoff 0
3101 .menubar.test.cascade add command -label SubItem -command "puts SubItemSelected"
3102 . configure -menu .menubar
3103 list [catch {.menubar.test add cascade -label SubMenu \
3104 -menu .menubar.test.cascade}] \
3105 [info commands .\#menubar.\#menubar\#test.\#menubar\#test\#cascade] \
3106 [. configure -menu ""]
3109 } -result {0 .#menubar.#menubar#test.#menubar#test#cascade {}}
3112 test menu-17.1 {MenuVarProc} -setup {
3118 list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
3123 # menu-17.2 - Don't know how to generate the flags in the if
3124 test menu-17.2 {MenuVarProc} -setup {
3129 list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
3134 test menu-17.3 {MenuVarProc} -setup {
3140 list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
3141 [set foo "hello"] [unset foo]
3144 } -result {{} hello {}}
3145 test menu-17.4 {MenuVarProc} -setup {
3150 list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
3151 [set foo "hello"] [unset foo]
3154 } -result {{} hello {}}
3155 test menu-17.5 {MenuVarProc} -setup {
3160 list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
3161 [set foo "goodbye"] [unset foo]
3164 } -result {{} goodbye {}}
3165 test menu-17.6 {MenuVarProc [5d991b822e]} -setup {
3168 # Want this not to crash
3171 .b add checkbutton -variable var
3172 trace add variable var unset {apply {args {
3173 .b entryconfigure 1 -variable {}
3179 test menu-17.7 {MenuVarProc [5d991b822e]} -setup {
3182 # Want this not to duplicate traces
3185 .b add checkbutton -variable var
3186 trace add variable var unset {apply {args {
3187 .b entryconfigure 1 -variable new
3195 test menu-18.1 {TkActivateMenuEntry} -setup {
3199 .m1 add command -label "test"
3204 test menu-18.2 {TkActivateMenuEntry} -setup {
3208 .m1 add command -label "test"
3213 test menu-18.3 {TkActivateMenuEntry} -setup {
3217 .m1 add command -label "test"
3218 .m1 add command -label "test2"
3224 test menu-18.4 {TkActivateMenuEntry} -setup {
3228 .m1 add command -label "test"
3229 .m1 add command -label "test2"
3237 test menu-19.1 {TkPostCommand} -constraints nonUnixUserInteraction -setup {
3240 menu .m1 -postcommand "set menu_test menu-19.1"
3241 .m1 add command -label "menu-19.1 - hit Escape"
3242 list [.m1 post 40 40] [.m1 unpost] [set menu_test]
3245 } -result {menu-19.1 {} menu-19.1}
3246 test menu-19.2 {TkPostCommand} -constraints nonUnixUserInteraction -setup {
3250 .m1 add command -label "menu-19.2 - hit Escape"
3251 list [.m1 post 40 40] [.m1 unpost]
3256 test menu-20.1 {CloneMenu} -setup {
3264 test menu-20.2 {CloneMenu} -setup {
3268 .m1 clone .m2 normal
3271 test menu-20.3 {CloneMenu} -setup {
3275 .m1 clone .m2 tearoff
3279 test menu-20.4 {CloneMenu} -setup {
3283 .m1 clone .m2 menubar
3287 test menu-20.5 {CloneMenu} -setup {
3292 } -returnCodes error -result {bad menu type "foo": must be normal, tearoff, or menubar}
3293 test menu-20.6 {CloneMenu - hooking up bookeeping ptrs} -setup {
3301 test menu-20.7 {CloneMenu - hooking up bookeeping ptrs - multiple children} -setup {
3310 test menu-20.8 {CloneMenu - cascade entries} -setup {
3314 .m1 add cascade -menu .m2
3319 test menu-20.9 {CloneMenu - cascades entries} -setup {
3323 .m1 add cascade -menu .m2
3329 test menu-20.10 {CloneMenu - tearoff fields} -setup {
3333 list [.m1 clone .m2 normal] [.m2 cget -tearoff]
3337 test menu-20.11 {CloneMenu} -setup {
3343 } -returnCodes error -result {window name "m2" already exists in parent}
3345 test menu-21.1 {MenuDoYPosition} -setup {
3350 } -returnCodes error -result {bad menu entry index "glorp"}
3351 test menu-21.2 {MenuDoYPosition} -setup {
3355 .m1 add command -label "Test"
3359 } -returnCodes ok -match glob -result {*}
3361 test menu-22.1 {GetIndexFromCoords} -setup {
3365 .m1 add command -label "test"
3366 .m1 configure -tearoff 0
3371 test menu-22.2 {GetIndexFromCoords} -setup {
3375 .m1 add command -label "test"
3376 .m1 configure -tearoff 0
3381 test menu-22.3 {GetIndexFromCoords: mapped window, y only} -setup {
3383 } -constraints {x11} -body {
3385 .m1 add command -label "test"
3386 .m1 configure -tearoff 0
3388 tkwait visibility .m1
3393 test menu-22.4 {GetIndexFromCoords: mapped window x,y} -setup {
3395 } -constraints {x11} -body {
3397 .m1 add command -label "test"
3398 .m1 configure -tearoff 0
3400 tkwait visibility .m1
3402 set x [expr {[winfo width .m1] - [.m1 cget -borderwidth] - 1}]
3407 test menu-22.5 {GetIndexFromCoords: mapped wide window} -setup {
3409 } -constraints {x11} -body {
3411 .m1 add command -label "test"
3412 .m1 configure -tearoff 0
3414 tkwait visibility .m1
3415 wm geometry .m1 200x100
3417 set x [expr {[winfo width .m1] - [.m1 cget -borderwidth] - 1}]
3423 test menu-23.1 {RecursivelyDeleteMenu} -setup {
3427 . configure -menu .m1
3428 . configure -menu ""
3432 test menu-23.2 {RecursivelyDeleteMenu} -setup {
3436 .m2 add command -label "test2"
3438 .m1 add cascade -label "test1" -menu .m2
3439 . configure -menu .m1
3440 . configure -menu ""
3445 test menu-24.1 {TkNewMenuName} -setup {
3449 list [. configure -menu .m1] [. configure -menu ""]
3453 test menu-24.2 {TkNewMenuName} -setup {
3458 list [. configure -menu .m1] [. configure -menu ""]
3462 test menu-24.3 {TkNewMenuName} -setup {
3467 list [catch {. configure -menu [menu .m]}] [. configure -menu ""] [destroy .#m] \
3468 [destroy .m] [destroy hideme]
3469 } -result {0 {} {} {} {}}
3472 test menu-25.1 {TkSetWindowMenuBar} -setup {
3475 . configure -menu ""
3476 list [. configure -menu .m1] [. configure -menu ""]
3480 test menu-25.2 {TkSetWindowMenuBar} -setup {
3483 . configure -menu ""
3484 list [. configure -menu .m1] [. configure -menu ""]
3488 test menu-25.3 {TkSetWindowMenuBar} -setup {
3491 . configure -menu ""
3494 list [. configure -menu .m1] [. configure -menu ""]
3498 test menu-25.4 {TkSetWindowMenuBar} -setup {
3501 . configure -menu ""
3503 . configure -menu .m1
3505 list [. configure -menu .m2] [. configure -menu ""]
3509 test menu-25.5 {TkSetWindowMenuBar} -setup {
3512 . configure -menu ""
3514 . configure -menu .m1
3517 list [. configure -menu .m3] [. configure -menu ""]
3521 test menu-25.6 {TkSetWindowMenuBar} -setup {
3524 . configure -menu ""
3527 . configure -menu .m2
3529 list [. configure -menu .m3] [. configure -menu ""]
3533 test menu-25.7 {TkSetWindowMenuBar} -setup {
3536 . configure -menu ""
3539 . configure -menu .m1
3541 .t2 configure -menu .m1
3542 list [.t2 configure -menu .m2] [. configure -menu ""]
3546 test menu-25.8 {TkSetWindowMenuBar} -setup {
3549 . configure -menu ""
3552 . configure -menu .m1
3554 wm geometry .t2 +0+0
3555 .t2 configure -menu .m1
3556 list [. configure -menu .m2] [. configure -menu ""]
3560 test menu-25.9 {TkSetWindowMenuBar} -setup {
3563 . configure -menu ""
3566 . configure -menu .m1
3567 toplevel .t2 -menu .m1
3568 wm geometry .t2 +0+0
3569 toplevel .t3 -menu .m1
3570 wm geometry .t3 +0+0
3571 list [.t3 configure -menu .m2] [. configure -menu ""]
3575 test menu-25.10 {TkSetWindowMenuBar} -setup {
3578 . configure -menu ""
3581 . configure -menu .m1
3582 toplevel .t2 -menu .m1
3583 wm geometry .t2 +0+0
3584 toplevel .t3 -menu .m1
3585 wm geometry .t3 +0+0
3586 list [.t2 configure -menu .m2] [. configure -menu ""]
3590 test menu-25.11 {TkSetWindowMenuBar} -setup {
3593 . configure -menu ""
3596 . configure -menu .m1
3597 toplevel .t2 -menu .m1
3598 wm geometry .t2 +0+0
3599 toplevel .t3 -menu .m1
3600 wm geometry .t3 +0+0
3601 list [. configure -menu .m2] [. configure -menu ""]
3605 test menu-25.12 {TkSetWindowMenuBar} -setup {
3608 . configure -menu ""
3610 list [. configure -menu .m1] [. configure -menu ""]
3614 test menu-25.13 {TkSetWindowMenuBar} -setup {
3617 . configure -menu ""
3618 list [. configure -menu .m1] [. configure -menu ""]
3622 test menu-25.14 {TkSetWindowMenuBar} -setup {
3625 . configure -menu ""
3627 list [. configure -menu .m1] [. configure -menu ""]
3631 test menu-25.15 {TkSetWindowMenuBar} -setup {
3634 . configure -menu ""
3635 list [. configure -menu .m1] [. configure -menu ""]
3639 test menu-25.16 {TkSetWindowMenuBar} -setup {
3642 . configure -menu ""
3644 . configure -menu .m1
3645 list [toplevel .t2 -menu m1] [. configure -menu ""]
3651 test menu-26.1 {DestroyMenuHashTable} -setup {
3652 catch {interp delete testinterp}
3655 interp create testinterp
3656 load {} Tk testinterp
3657 interp eval testinterp {menu .m1}
3658 interp delete testinterp
3659 } -returnCodes ok -result {}
3662 test menu-27.1 {GetMenuHashTable} -setup {
3663 catch {interp delete testinterp}
3666 interp create testinterp
3667 load {} Tk testinterp
3668 list [catch {interp eval testinterp {menu .m1}} msg] $msg [interp delete testinterp]
3671 } -result {0 .m1 {}}
3674 test menu-28.1 {TkCreateMenuReferences - not there before} -setup {
3681 test menu-28.2 {TkCreateMenuReferences - there already} -setup {
3685 .m1 add cascade -menu .m2
3692 test menu-29.1 {TkFindMenuReferences - not there} -setup {
3695 . configure -menu ""
3697 .m1 add cascade -menu .m2
3698 list [. configure -menu .m1] [. configure -menu ""]
3704 test menu-30.1 {TkFindMenuReferences - there already} -setup {
3707 . configure -menu ""
3710 .m1 add cascade -menu .m2
3711 list [. configure -menu .m1] [. configure -menu ""]
3717 test menu-31.1 {TkFreeMenuReferences - menuPtr} -setup {
3725 test menu-31.2 {TkFreeMenuReferences - cascadePtr} -setup {
3728 . configure -menu ""
3730 .m1 add cascade -menu .m2
3731 .m1 entryconfigure 1 -menu .m3
3735 test menu-31.3 {TkFreeMenuReferences - topLevelListPtr} -setup {
3738 . configure -menu .m1
3739 . configure -menu ""
3742 } -returnCodes ok -result {}
3743 test menu-31.4 {TkFreeMenuReferences - not empty} -setup {
3747 .m1 add cascade -menu .m3
3749 .m2 add cascade -menu .m3
3750 .m2 entryconfigure 1 -menu ".foo"
3756 test menu-32.1 {DeleteMenuCloneEntries} -setup {
3760 .m1 add command -label foo
3766 test menu-32.2 {DeleteMenuCloneEntries} -setup {
3771 .m1 add command -label one
3772 .m1 add command -label two
3773 .m1 add command -label three
3774 .m1 add command -label four
3780 test menu-32.3 {DeleteMenuCloneEntries} -setup {
3784 .m1 add command -label one
3785 .m1 add command -label two
3786 .m1 add command -label three
3787 .m1 add command -label four
3789 .m2 configure -tearoff 1
3794 test menu-32.4 {DeleteMenuCloneEntries} -setup {
3798 .m1 add command -label one
3799 .m1 add command -label two
3800 .m1 add command -label three
3801 .m1 add command -label four
3803 .m2 configure -tearoff 0
3808 test menu-32.5 {DeleteMenuCloneEntries} -setup {
3812 .m1 add command -label one
3813 .m1 add command -label two
3820 test menu-32.6 {DeleteMenuCloneEntries - reentrancy - crashes tk8.0} -setup {
3824 .m1 add command -label test \
3825 -command ".m1 delete test ; .m1 add command -label test -command \".m1 delete test\"; .m1 delete test"
3830 test menu-32.7 {DeleteMenuCloneEntries - one entry} -setup {
3834 .m1 add command -label Hello
3839 test menu-32.8 {Ensure all menu clone commands are deleted} -setup {
3844 . configure -menu .menubar
3846 .menubar.test add command -label "hi"
3847 for {set i 0} {$i < 10} {incr i} {
3848 .menubar add cascade -menu .menubar.test -label "Test"
3849 .menubar delete Test
3852 info commands .#menubar*test*
3856 test menu-32.9 {Ensure deleting of clones doesn't corrupt menu refs} -setup {
3861 . configure -menu .menubar
3863 .menubar add cascade -menu .menubar.test -label "Test"
3864 menu .menubar.cascade
3866 .menubar.test add cascade -menu .menubar.cascade -label "Cascade"
3867 lappend res [.menubar.test entrycget 1 -menu]
3868 lappend res [.#menubar.#menubar#test entrycget 1 -menu]
3869 destroy .menubar.test
3871 .menubar.test add cascade -menu .menubar.cascade -label "Cascade"
3872 lappend res [.menubar.test entrycget 1 -menu]
3873 lappend res [.#menubar.#menubar#test entrycget 1 -menu]
3877 } -result {.menubar.cascade .#menubar.#menubar#test.#menubar#cascade .menubar.cascade .#menubar.#menubar#test.#menubar#cascade}
3880 test menu-33.1 {menu vs command hiding} -setup {
3883 set l [interp hidden]
3887 set result [list [winfo children .] [interp hidden]]
3888 expr {$result eq [list {} $l]}
3891 # menu-34 MenuInit only called at boot time
3893 # creating menus on two different screens then deleting the
3894 # menu from the first screen crashes Tk8.3.1
3896 test menu-34.1 {menus on multiple screens - crashes tk8.3.1, Bug 5454} -constraints {
3903 toplevel .two -screen $::env(TK_ALT_DISPLAY)
3909 test menu-35.1 {menu -underline string overruns Bug 1599877} -setup {
3912 # ensure that -underline does not do string overruns [Bug 1599877]
3914 .m add command -label "File" -underline [expr {1<<30}]
3915 . configure -menu .m
3917 tk::TraverseToMenu . "e"
3922 test menu-37.1 {menubar menues cannot be posted - bug 2160206} -setup {
3925 # On Linux the following used to panic
3926 # It now returns an error (on all platforms)
3927 menu .m -type menubar
3928 list [catch ".m post 1 1" msg] $msg
3931 } -result {1 {a menubar menu cannot be posted}}
3933 test menu-38.1 {Can't dismiss ttk::menubutton menu until mouse has hovered over it - bug fa32290898} -setup {
3934 } -constraints {x11} -body {
3936 ttk::menubutton .top.mb -text "Some menu";
3938 .top.mb.m add command -label "Item 1";
3939 .top.mb.m add command -label "Item 2";
3940 .top.mb configure -menu .top.mb.m;
3943 # simulate mouse click on the menubutton, which posts its menu
3944 event generate .top.mb <Button-1> -warp 1
3945 controlPointerWarpTiming
3946 event generate .top.mb <ButtonRelease-1>
3948 # simulate mouse click on the menu again, i.e. without
3949 # entering/leaving the posted menu
3950 event generate .top.mb <Button-1>
3953 event generate .top.mb <ButtonRelease-1>
3955 # the menu shall have been unposted by the second click
3956 winfo ismapped .top.mb.m
3958 destroy .top.mb.m .top.m .top