1
# This file is a Tcl script to test menus in Tk. It is
2
# organized in the standard fashion for Tcl tests. This
3
# file tests the Macintosh-specific features of the menu
6
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
8
# See the file "license.terms" for information on usage and redistribution
9
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
# RCS: @(#) $Id: unixMenu.test,v 1.2 1998/09/14 18:23:52 stanton Exp $
13
if {$tcl_platform(platform) != "unix"} {
17
if {[lsearch [image types] test] < 0} {
18
puts "This application hasn't been compiled with the \"test\" image"
19
puts "type, so I can't run this test. Are you sure you're using"
20
puts "tktest instead of wish?"
24
if {[info procs test] != "test"} {
28
proc deleteWindows {} {
29
foreach i [winfo children .] {
38
test unixMenu-1.1 {TkpNewMenu - normal menu} {
40
list [catch {menu .m1} msg] $msg [destroy .m1]
42
test unixMenu-1.2 {TkpNewMenu - help menu} {
46
.m1 add cascade -label Help -menu .m1.help
47
list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1]
50
test unixMenu-2.1 {TkpDestroyMenu - nothing to do} {} {}
51
test unixMenu-3.1 {TkpDestroymenuEntry - nothing to do} {} {}
53
test unixMenu-4.1 {TkpConfigureMenuEntry - non-cascade entry} {
56
.m1 add command -label test
57
list [catch {.m1 entryconfigure test -label foo} msg] $msg [destroy .m1]
59
test unixMenu-4.2 {TkpConfigureMenuEntry - cascade entry} {
62
.m1 add cascade -menu .m2 -label test
63
menu .m1.foo -tearoff 0
64
list [catch {.m1 entryconfigure test -menu .m1.foo} msg] $msg [destroy .m1]
67
test unixMenu-5.1 {TkpMenuNewEntry - nothing to do} {} {}
69
test unixMenu-6.1 {TkpSetWindowMenuBar - null menu} {
72
.m1 add cascade -label foo
74
list [catch {. configure -menu ""} msg] $msg [destroy .m1]
76
test unixMenu-6.2 {TkpSetWindowMenuBar - menu} {
79
.m1 add cascade -label foo
80
list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
83
test unixMenu-7.1 {TkpSetMainMenubar - nothing to do} {} {}
85
test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} {
88
.m1 add checkbutton -label foo -indicatoron 0
89
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
91
test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} {
94
.m1 add command -label foo
95
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
97
test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} {
99
catch {image delete image1}
101
image create test image1
102
.m1 add checkbutton -image image1 -label foo
104
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
106
test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} {
109
.m1 add checkbutton -bitmap questhead -label foo
111
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
113
test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} {
116
.m1 add checkbutton -label foo
118
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
120
test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} {
122
catch {image delete image1}
124
image create test image1
125
.m1 add radiobutton -image image1 -label foo
127
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
129
test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} {
132
.m1 add radiobutton -bitmap questhead -label foo
134
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
136
test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} {
139
.m1 add radiobutton -label foo
141
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
143
test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} {
146
.m1 add radiobutton -label foo -hidemargin 1
148
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
151
test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} {
154
.m1 add cascade -label foo
155
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
157
test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} {
160
.m1 add command -label foo -accel "Ctrl+S"
161
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
163
test unixMenu-9.3 {GetMenuAccelGeometry - null label} {
166
.m1 add command -label foo
167
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
170
test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} {
173
.m1 add cascade -label foo
174
. configure -menu .m1
176
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
178
test unixMenu-10.2 {DrawMenuEntryBackground - active} {
181
.m1 add command -label foo
182
set tearoff [tkTearOffMenu .m1 40 40]
184
list [catch {update} msg] $msg [destroy .m1]
186
test unixMenu-10.3 {DrawMenuEntryBackground - non-active} {
189
.m1 add command -label foo
190
set tearoff [tkTearOffMenu .m1 40 40]
191
list [catch {update} msg] $msg [destroy .m1]
194
test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} {
197
.m1 add command -label foo -accel "Ctrl+U"
198
. configure -menu .m1
199
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
201
# drawArrow parameter is never false under Unix
202
test unixMenu-11.2 {DrawMenuEntryAccelerator - cascade entry} {
205
.m1 add cascade -label foo
206
set tearoff [tkTearOffMenu .m1 40 40]
207
list [catch {update} msg] $msg [destroy .m1]
209
test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} {
212
.m1 add command -label foo -accel "Ctrl+U"
213
set tearoff [tkTearOffMenu .m1 40 40]
214
list [catch {update} msg] $msg [destroy .m1]
216
test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} {
219
.m1 add command -label foo
220
set tearoff [tkTearOffMenu .m1 40 40]
221
list [catch {update} msg] $msg [destroy .m1]
224
test unixMenu-12.1 {DrawMenuEntryIndicator - non-check or radio} {
227
.m1 add command -label foo
228
set tearoff [tkTearOffMenu .m1 40 40]
229
list [catch {update} msg] $msg [destroy .m1]
231
test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} {
234
.m1 add checkbutton -label foo -indicatoron 0
235
set tearoff [tkTearOffMenu .m1 40 40]
236
list [catch {update} msg] $msg [destroy .m1]
238
test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} {
241
.m1 add checkbutton -label foo
242
set tearoff [tkTearOffMenu .m1 40 40]
243
list [catch {update} msg] $msg [destroy .m1]
245
test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} {
248
.m1 add checkbutton -label foo
250
set tearoff [tkTearOffMenu .m1 40 40]
251
list [catch {update} msg] $msg [destroy .m1]
253
test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} {
256
.m1 add radiobutton -label foo -indicatoron 0
257
set tearoff [tkTearOffMenu .m1 40 40]
258
list [catch {update} msg] $msg [destroy .m1]
260
test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} {
263
.m1 add radiobutton -label foo
264
set tearoff [tkTearOffMenu .m1 40 40]
265
list [catch {update} msg] $msg [destroy .m1]
267
test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} {
270
.m1 add radiobutton -label foo
272
set tearoff [tkTearOffMenu .m1 40 40]
273
list [catch {update} msg] $msg [destroy .m1]
276
test unixMenu-13.1 {DrawMenuSeparator - menubar case} {
280
. configure -menu .m1
281
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
283
test unixMenu-13.2 {DrawMenuSepartor - normal menu} {
287
set tearoff [tkTearOffMenu .m1 40 40]
288
list [catch {update} msg] $msg [destroy .m1]
291
test unixMenu-14.1 {DrawMenuEntryLabel} {
294
.m1 add command -label foo
295
set tearoff [tkTearOffMenu .m1 40 40]
296
list [catch {update} msg] $msg [destroy .m1]
299
test unixMenu-15.1 {DrawMenuUnderline - menubar} {
302
.m1 add command -label foo -underline 0
303
. configure -menu .m1
304
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
306
test unixMenu-15.2 {DrawMenuUnderline - no menubar} {
309
.m1 add command -label foo -underline 0
310
set tearoff [tkTearOffMenu .m1 40 40]
311
list [catch {update} msg] $msg [destroy .m1]
314
test unixMenu-16.1 {TkpPostMenu} {
317
.m1 add command -label foo
318
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
321
test unixMenu-17.1 {GetMenuSeparatorGeometry} {
325
list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
328
test unixMenu-18.1 {GetTearoffEntryGeometry} {
330
menubutton .mb -text "test" -menu .mb.m
332
.mb.m add command -label test
335
list [catch {tkMbPost .mb} msg] $msg [destroy .mb]
338
# Don't know how to reproduce the case where the tkwin has been deleted.
339
test unixMenu-19.1 {TkpComputeMenubarGeometry - zero entries} {
342
. configure -menu .m1
343
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
345
# Don't know how to generate one width windows
346
test unixMenu-19.2 {TkpComputeMenubarGeometry - one entry} {
349
.m1 add cascade -label File
350
. configure -menu .m1
351
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
353
test unixMenu-19.3 {TkpComputeMenubarGeometry - entry with different font} {
355
menu .m1 -font "Courier 24"
356
.m1 add cascade -label File -font "Helvetica 18"
357
. configure -menu .m1
358
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
360
test unixMenu-19.4 {TkpComputeMenubarGeometry - separator} {
364
. configure -menu .m1
365
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
367
test unixMenu-19.5 {TkpComputeMenubarGeometry - First entry} {
370
.m1 add cascade -label File
371
. configure -menu .m1
372
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
374
test unixMenu-19.6 {TkpComputeMenubarGeometry - First entry too wide} {
377
.m1 add cascade -label File -font "Times 72"
378
. configure -menu .m1
380
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
382
test unixMenu-19.7 {TkpComputeMenubarGeometry - two entries fit} {
385
.m1 add cascade -label File
386
.m1 add cascade -label Edit
387
. configure -menu .m1
388
wm geometry . 200x200
389
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
391
test unixMenu-19.8 {TkpComputeMenubarGeometry - two entries; 2nd don't fit} {
394
.m1 add cascade -label File
395
.m1 add cascade -label Edit -font "Times 72"
396
. configure -menu .m1
397
wm geometry . 100x100
398
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
400
test unixMenu-19.9 {TkpComputeMenubarGeometry - two entries; 1st dont fit} {
403
.m1 add cascade -label File -font "Times 72"
404
.m1 add cascade -label Edit
405
. configure -menu .m1
406
wm geometry . 100x100
407
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
409
test unixMenu-19.10 {TkpComputeMenubarGeometry - two entries; neither fit} {
411
menu .m1 -tearoff 0 -font "Times 72"
412
.m1 add cascade -label File
413
.m1 add cascade -label Edit
414
. configure -menu .m1
416
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
418
# ABC notation; capital A means first window fits, small a means it
419
# does not. capital B menu means second window fist, etc.
420
test unixMenu-19.11 {TkpComputeMenubarGeometry - abc} {
422
menu .m1 -tearoff 0 -font "Times 72"
423
.m1 add cascade -label "aaaaa"
424
.m1 add cascade -label "bbbbb"
425
.m1 add cascade -label "ccccc"
426
. configure -menu .m1
428
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
430
test unixMenu-19.12 {TkpComputeMenubarGeometry - abC} {
433
.m1 add cascade -label "aaaaa" -font "Times 72"
434
.m1 add cascade -label "bbbbb" -font "Times 72"
435
.m1 add cascade -label "C"
436
. configure -menu .m1
438
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
440
test unixMenu-19.13 {TkpComputeMenubarGeometry - aBc} {
443
.m1 add cascade -label "aaaaa" -font "Times 72"
444
.m1 add cascade -label "B"
445
.m1 add cascade -label "ccccc" -font "Times 72"
446
. configure -menu .m1
448
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
450
test unixMenu-19.14 {TkpComputeMenubarGeometry - aBC} {
453
.m1 add cascade -label "aaaaa" -font "Times 72"
454
.m1 add cascade -label "B"
455
.m1 add cascade -label "C"
456
. configure -menu .m1
458
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
460
test unixMenu-19.15 {TkpComputeMenubarGeometry - Abc} {
463
.m1 add cascade -label "A"
464
.m1 add cascade -label "bbbbb" -font "Times 72"
465
.m1 add cascade -label "ccccc" -font "Times 72"
466
. configure -menu .m1
468
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
470
test unixMenu-19.16 {TkpComputeMenubarGeometry - AbC} {
473
.m1 add cascade -label "A"
474
.m1 add cascade -label "bbbbb" -font "Times 72"
475
.m1 add cascade -label "C"
476
. configure -menu .m1
478
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
480
test unixMenu-19.17 {TkpComputeMenubarGeometry - ABc} {
483
.m1 add cascade -label "A"
484
.m1 add cascade -label "B"
485
.m1 add cascade -label "ccccc" -font "Times 72"
486
. configure -menu .m1
488
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
490
test unixMenu-19.18 {TkpComputeMenubarGeometry - ABC} {
493
.m1 add cascade -label "A"
494
.m1 add cascade -label "B"
495
.m1 add cascade -label "C"
496
. configure -menu .m1
498
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
500
test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} {
503
.m1 add cascade -label Help -menu .m1.help
504
menu .m1.help -tearoff 0
505
.m1 add cascade -label File -menu .m1.file
506
menu .m1.file -tearoff 0
507
.m1 add cascade -label Edit -menu .m1.edit
508
menu .m1.edit -tearoff 0
509
. configure -menu .m1
511
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
513
test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} {
516
.m1 add cascade -label Edit -menu .m1.edit
517
menu .m1.edit -tearoff 0
518
.m1 add cascade -label Help -menu .m1.help
519
menu .m1.help -tearoff 0
520
.m1 add cascade -label File -menu .m1.file
521
menu .m1.file -tearoff 0
522
. configure -menu .m1
524
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
526
test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} {
529
.m1 add cascade -label File -menu .m1.file
530
menu .m1.file -tearoff 0
531
.m1 add cascade -label Edit -menu .m1.edit
532
menu .m1.edit -tearoff 0
533
.m1 add cascade -label Help -menu .m1.help
534
menu .m1.help -tearoff 0
535
. configure -menu .m1
537
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
539
test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} {
542
.m1 add cascade -label File -menu .m1.file
543
menu .m1.file -tearoff 0
544
.m1 add cascade -label Help -menu .m1.help
545
menu .m1.help -tearoff 0
546
. configure -menu .m1
548
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
550
test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} {
553
.m1 add cascade -label File -menu .m1.file
554
menu .m1.file -tearoff 0
555
.m1 add cascade -label Help -menu .m1.help -font "Helvetica 72"
556
menu .m1.help -tearoff 0
557
. configure -menu .m1
559
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
561
test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} {
564
.m1 add cascade -label Help -menu .m1.help
565
menu .m1.help -tearoff 0
566
. configure -menu .m1
568
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
571
test unixMenu-20.1 {DrawTearoffEntry - menubar} {
574
.m1 add cascade -label File
575
. configure -menu .m1
576
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
578
test unixMenu-20.2 {DrawTearoffEntry - non-menubar} {
581
.m1 add command -label foo
583
list [catch {update} msg] $msg [destroy .m1]
586
test unixMenu-21.1 {TkpInitializeMenuBindings - nothing to do} {} {}
588
test unixMenu-22.1 {SetHelpMenu - no menubars} {
591
.m1 add cascade -label test -menu .m1.test
592
list [catch {menu .m1.test} msg] $msg [destroy .m1]
594
# Don't know how to automate missing tkwins
595
test unixMenu-22.2 {SetHelpMenu - menubar but no help menu} {
598
. configure -menu .m1
599
.m1 add cascade -label .m1.file
600
list [catch {menu .m1.file} msg] $msg [. configure -menu ""] [destroy .m1]
602
test unixMenu-22.3 {SetHelpMenu - menubar with help menu} {
605
. configure -menu .m1
606
.m1 add cascade -label .m1.help
607
list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1]
609
test unixMenu-22.4 {SetHelpMenu - multiple menubars with same help menu} {
613
wm geometry .t2 +40+40
615
. configure -menu .m1
616
.t2 configure -menu .m1
617
.m1 add cascade -label .m1.help
618
list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .t2]
619
} {0 .m1.help {} {} {}}
621
test unixMenu-23.1 {TkpDrawMenuEntry - gc for active and not strict motif} {
624
.m1 add command -label foo
625
set tearoff [tkTearOffMenu .m1 40 40]
626
.m1 entryconfigure 1 -state active
627
list [update] [destroy .m1]
629
test unixMenu-23.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} {
632
.m1 add command -label foo -activeforeground red
633
set tearoff [tkTearOffMenu .m1 40 40]
634
.m1 entryconfigure 1 -state active
635
list [update] [destroy .m1]
637
test unixMenu-23.3 {TkpDrawMenuEntry - gc for active and strict motif} {
641
.m1 add command -label foo
642
set tearoff [tkTearOffMenu .m1 40 40]
643
.m1 entryconfigure 1 -state active
644
list [update] [destroy .m1] [set tk_strictMotif 0]
646
test unixMenu-23.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} {
648
menu .m1 -disabledforeground blue
649
.m1 add command -label foo -state disabled -background red
650
set tearoff [tkTearOffMenu .m1 40 40]
651
list [update] [destroy .m1]
653
test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {
655
menu .m1 -disabledforeground blue
656
.m1 add command -label foo -state disabled
657
set tearoff [tkTearOffMenu .m1 40 40]
658
list [update] [destroy .m1]
660
test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {
662
menu .m1 -disabledforeground ""
663
.m1 add command -label foo -state disabled
664
set tearoff [tkTearOffMenu .m1 40 40]
665
list [update] [destroy .m1]
667
test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} {
670
.m1 add command -label foo -foreground red
671
set tearoff [tkTearOffMenu .m1 40 40]
672
list [update] [destroy .m1]
674
test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} {
677
.m1 add command -label foo
678
set tearoff [tkTearOffMenu .m1 40 40]
679
list [update] [destroy .m1]
681
test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {
684
.m1 add checkbutton -label foo -selectcolor orange
686
set tearoff [tkTearOffMenu .m1 40 40]
687
list [update] [destroy .m1]
689
test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} {
692
.m1 add checkbutton -label foo
694
set tearoff [tkTearOffMenu .m1 40 40]
695
list [update] [destroy .m1]
697
test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} {
700
.m1 add command -label foo -activebackground green
701
set tearoff [tkTearOffMenu .m1 40 40]
702
.m1 entryconfigure 1 -state active
703
list [update] [destroy .m1]
705
test unixMenu-23.12 {TkpDrawMenuEntry - border} {
708
.m1 add command -label foo
709
set tearoff [tkTearOffMenu .m1 40 40]
710
.m1 entryconfigure 1 -state active
711
list [update] [destroy .m1]
713
test unixMenu-23.13 {TkpDrawMenuEntry - active border - strict motif} {
717
.m1 add command -label foo
718
set tearoff [tkTearOffMenu .m1 40 40]
719
.m1 entryconfigure 1 -state active
720
list [update] [destroy .m1] [set tk_strictMotif 0]
722
test unixMenu-23.14 {TkpDrawMenuEntry - active border - custom entry} {
725
.m1 add command -label foo -activeforeground yellow
726
set tearoff [tkTearOffMenu .m1 40 40]
727
.m1 entryconfigure 1 -state active
728
list [update] [destroy .m1]
730
test unixMenu-23.15 {TkpDrawMenuEntry - active border} {
733
.m1 add command -label foo
734
set tearoff [tkTearOffMenu .m1 40 40]
735
.m1 entryconfigure 1 -state active
736
list [update] [destroy .m1]
738
test unixMenu-23.16 {TkpDrawMenuEntry - font - custom entry} {
741
.m1 add command -label foo -font "Helvectica 72"
742
set tearoff [tkTearOffMenu .m1 40 40]
743
list [update] [destroy .m1]
745
test unixMenu-23.17 {TkpDrawMenuEntry - font} {
747
menu .m1 -font "Courier 72"
748
.m1 add command -label foo
749
set tearoff [tkTearOffMenu .m1 40 40]
750
list [update] [destroy .m1]
752
test unixMenu-23.18 {TkpDrawMenuEntry - separator} {
756
set tearoff [tkTearOffMenu .m1 40 40]
757
list [update] [destroy .m1]
759
test unixMenu-23.19 {TkpDrawMenuEntry - standard} {
762
.m1 add command -label foo
763
set tearoff [tkTearOffMenu .m1 40 40]
764
list [update] [destroy .m1]
766
test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} {
769
.m1 add cascade -label File -menu .m1.file
771
.m1.file add command -label foo
772
.m1 entryconfigure File -state disabled
773
set tearoff [tkTearOffMenu .m1 40 40]
774
list [update] [destroy .m1]
776
test unixMenu-23.21 {TkpDrawMenuEntry - indicator} {
779
.m1 add checkbutton -label Foo
781
set tearoff [tkTearOffMenu .m1 40 40]
782
list [update] [destroy .m1]
784
test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} {
787
.m1 add checkbutton -label Foo -hidemargin 1
789
set tearoff [tkTearOffMenu .m1 40 40]
790
list [update] [destroy .m1]
793
test unixMenu-24.1 {GetMenuLabelGeometry - image} {
795
catch {image delete image1}
797
image create test image1
798
.m1 add command -image image1
799
list [update idletasks] [destroy .m1] [image delete image1]
801
test unixMenu-24.2 {GetMenuLabelGeometry - bitmap} {
804
.m1 add command -bitmap questhead
805
list [update idletasks] [destroy .m1]
807
test unixMenu-24.3 {GetMenuLabelGeometry - no text} {
811
list [update idletasks] [destroy .m1]
813
test unixMenu-24.4 {GetMenuLabelGeometry - text} {
816
.m1 add command -label "This is a test."
817
list [update idletasks] [destroy .m1]
820
test unixMenu-25.1 {TkpComputeStandardMenuGeometry - no entries} {
823
list [update idletasks] [destroy .m1]
825
test unixMenu-25.2 {TkpComputeStandardMenuGeometry - one entry} {
828
.m1 add command -label "one"
829
list [update idletasks] [destroy .m1]
831
test unixMenu-25.3 {TkpComputeStandardMenuGeometry - more than one entry} {
834
.m1 add command -label "one"
835
.m1 add command -label "two"
836
list [update idletasks] [destroy .m1]
838
test unixMenu-25.4 {TkpComputeStandardMenuGeometry - separator} {
842
list [update idletasks] [destroy .m1]
844
test unixMenu-25.5 {TkpComputeStandardMenuGeometry - tearoff entry} {unixOnly} {
846
menubutton .mb -text "test" -menu .mb.m
848
.mb.m add command -label test
851
list [update] [destroy .mb]
853
test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} {
856
.m1 add command -label "test"
857
list [update idletasks] [destroy .m1]
859
test unixMenu-25.7 {TkpComputeStandardMenuGeometry - different font for entry} {
861
menu .m1 -font "Helvetica 12"
862
.m1 add command -label "test" -font "Courier 12"
863
list [update idletasks] [destroy .m1]
865
test unixMenu-25.8 {TkpComputeStandardMenuGeometry - second entry larger} {
868
.m1 add command -label "test"
869
.m1 add command -label "test test"
870
list [update idletasks] [destroy .m1]
872
test unixMenu-25.9 {TkpComputeStandardMenuGeometry - first entry larger} {
875
.m1 add command -label "test test"
876
.m1 add command -label "test"
877
list [update idletasks] [destroy .m1]
879
test unixMenu-25.10 {TkpComputeStandardMenuGeometry - accelerator} {
882
.m1 add command -label "test" -accel "Ctrl+S"
883
list [update idletasks] [destroy .m1]
885
test unixMenu-25.11 {TkpComputeStandardMenuGeometry - second accel larger} {
888
.m1 add command -label "test" -accel "1"
889
.m1 add command -label "test" -accel "1 1"
890
list [update idletasks] [destroy .m1]
892
test unixMenu-25.12 {TkpComputeStandardMenuGeometry - second accel smaller} {
895
.m1 add command -label "test" -accel "1 1"
896
.m1 add command -label "test" -accel "1"
897
list [update idletasks] [destroy .m1]
899
test unixMenu-25.13 {TkpComputeStandardMenuGeometry - indicator} {
902
.m1 add checkbutton -label test
904
list [update idletasks] [destroy .m1]
906
test unixMenu-25.14 {TkpComputeStandardMenuGeometry - second indicator less or equal } {
908
catch {image delete image1}
909
image create test image1
911
.m1 add checkbutton -image image1
913
.m1 add checkbutton -label test
915
list [update idletasks] [destroy .m1] [image delete image1]
917
test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger } {unixOnly} {
919
catch {image delete image1}
920
image create test image1
922
.m1 add checkbutton -image image1
924
.m1 add checkbutton -label test
926
list [update idletasks] [destroy .m1] [image delete image1]
928
test unixMenu-25.16 {TkpComputeStandardMenuGeometry - zero sized menus} {
931
list [update idletasks] [destroy .m1]
933
test unixMenu-25.17 {TkpComputeStandardMenuGeometry - first column bigger} {
936
.m1 add command -label one
937
.m1 add command -label two
938
.m1 add command -label three -columnbreak 1
939
list [update idletasks] [destroy .m1]
941
test unixMenu-25.18 {TkpComputeStandardMenuGeometry - second column bigger} {
944
.m1 add command -label one
945
.m1 add command -label two -columnbreak 1
946
.m1 add command -label three
947
list [update idletasks] [destroy .m1]
949
test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} {
952
.m1 add command -label one
953
.m1 add command -label two -columnbreak 1
954
.m1 add command -label three
955
.m1 add command -label four
956
.m1 add command -label five -columnbreak 1
957
.m1 add command -label six
958
list [update idletasks] [destroy .m1]
960
test unixMenu-25.20 {TkpComputeStandardMenuGeometry - hide margin} {
963
.m1 add checkbutton -label one -hidemargin 1
964
list [update idletasks] [destroy .m1]
967
test unixMenu-26.1 {TkpMenuInit - nothing to do} {} {}