head	1.12;
access;
symbols
	core-8-5-9:1.10
	core-8-5-8:1.10
	macosx-cocoa-merge:1.12
	macosx-cocoa-premerge:1.12
	macosx-carbon-freeze:1.12
	core-8-5-7:1.10
	core-8-5-6:1.10
	core-8-6-b1:1.11
	core-8-6-a3:1.11
	core-8-5-5:1.10
	core-8-6-a2:1.11
	core-8-5-4:1.10
	core-8-5-3:1.10
	core-8-6-a1:1.10
	core-8-4-19:1.5
	core-8-5-branch:1.10.0.4
	core-8-5-2:1.10
	core-8-4-18:1.5
	core-8-5-1:1.10
	core-8-4-17:1.5
	core-8-5-0:1.10
	core-8-5-b3:1.10
	core-8-5-b2:1.10
	core-8-4-16:1.5
	core-8-5-b1:1.10
	core-stablilizer-merge:1.10
	core-stabilizer-branch:1.10.0.2
	core-stabilizer-merge:1.10
	core-8-4-15:1.5
	core-8-5-a6:1.9
	core-8-5-a5:1.9
	core-8-4-14:1.5
	core-8-5-a4:1.9
	core-8-4-13:1.5
	core-8-4-12:1.5
	core-8-4-11:1.5
	core-8-5-a3:1.9
	core-8-4-10:1.5
	core-8-4-9-branch:1.5.0.4
	core-8-5-a2:1.9
	core-8-4-9:1.5
	core-8-4-8:1.5
	core-8-4-7:1.5
	core-8-5-a1:1.6
	core-8-4-6:1.5
	core-8-4-5:1.5
	mistachkin-dev-branch:1.6.0.2
	core-8-4-4:1.5
	core-8-4-3:1.5
	core-8-4-branch:1.5.0.2
	core-8-4-2:1.5
	core-8-4-1:1.5
	core-8-3-5:1.3
	core-8-4-0:1.5
	macosx-8-4-merge-2002-08-31-trunk:1.5
	macosx-8-4-premerge-2002-08-31-branch:1.4.2.1
	macosx-8-4-premerge-2002-08-31-trunk:1.5
	macosx-8-4-merge-2002-08-30-branch:1.4.2.1
	macosx-8-4-merge-2002-08-30-trunk:1.5
	macosx-8-4-merge-2002-08-20-branch:1.4.2.1
	macosx-8-4-merge-2002-08-20-trunk:1.5
	core-8-4-b2:1.5
	core-8-4-b1:1.4
	macosx-premerge-6-9-02:1.4
	core-8-4-a4:1.4
	core-8-3-4:1.3
	macosx-8-4-branch:1.4.0.2
	macosx-8-4-branchpoint:1.4
	core-8-4-a3:1.4
	core-8-3-3:1.3
	dgp-privates-into-namespace:1.3.0.16
	tclpro-1-5-0:1.3
	core-8-4-win-speedup:1.3.0.14
	core-8-4-a2:1.3
	tclpro-1-4-1:1.3
	tclpro-1-4-0:1.3
	core-8-3-2:1.3
	ajuba-ajuba2-2-1-base:1.3
	ajuba-ajuba2-2-0:1.3
	core-8-4-a1:1.3
	core-8-3-1-branch:1.3.0.12
	core-8-3-1:1.3
	scriptics-sc-2-0-b5:1.3
	scriptics-sc-2-0-fixed:1.3
	scriptics-sc-2-0-b2:1.3
	scriptics-sc-2-0-b1:1.3
	core-8-3-0:1.3
	core-8-3-b2:1.3
	core-8-3-b1:1.3
	scriptics-sc-1-1:1.3
	scriptics-sc-1-1-b1:1.3
	core-8-2-3:1.3
	scriptics-sc-1-1-branch:1.3.0.10
	scriptics-sc-1-1-base:1.3
	scriptics-sc-1-0:1.3
	scriptics-sc-1-0-branch:1.3.0.8
	scriptics-sc-1-0-base:1.3
	core-8-2-2:1.3
	core-8-2-1:1.3
	scriptics-bc-1-0-b1:1.3
	core-8-2-1-branch:1.3.0.6
	scriptics-tclpro-1-3-0:1.3
	core-8-2-0:1.3
	core-8-2-b3-branch:1.3.0.4
	core-8-2-b3-base:1.3
	scriptics-tclpro-1-3-b4:1.3
	core-8-2-b2:1.3
	scriptics-tclpro-1-3-b3:1.3
	core-8-2-b1:1.3
	scriptics-tclpro-1-3-b2:1.3
	merge-to-mainline-5/21/99:1.3
	scriptics-tclpro-1-3-b2-branch:1.3.0.2
	core-8-1-1:1.3
	scriptics-tclpro-1-3-b1:1.3
	core-8-1-1-base:1.3
	core-8-1-0:1.3
	merge-to-mainline-4-29-99:1.3
	merge-to-mainline-4-23-99:1.3
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.6
	core-8-1-b2:1.1.4.3
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.2
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.12
date	2009.01.13.01.46.06;	author patthoyts;	state Exp;
branches;
next	1.11;

1.11
date	2008.08.21.11.19.33;	author aniap;	state Exp;
branches;
next	1.10;

1.10
date	2007.05.09.12.52.44;	author das;	state Exp;
branches;
next	1.9;

1.9
date	2004.06.24.12.45.43;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2004.05.23.17.34.48;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2004.03.17.18.15.49;	author das;	state Exp;
branches;
next	1.6;

1.6
date	2003.04.01.21.06.43;	author dgp;	state Exp;
branches;
next	1.5;

1.5
date	2002.07.13.20.28.35;	author dgp;	state Exp;
branches;
next	1.4;

1.4
date	2001.08.01.16.21.12;	author dgp;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	99.04.16.01.51.39;	author stanton;	state Exp;
branches
	1.3.14.1
	1.3.16.1;
next	1.2;

1.2
date	98.09.14.18.23.48;	author stanton;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.58.13;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.29.00.25.51;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.09.30.02.18.48;	author stanton;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	99.03.11.18.51.00;	author hershey;	state Exp;
branches;
next	1.1.4.4;

1.1.4.4
date	99.03.24.01.16.57;	author hershey;	state Exp;
branches;
next	1.1.4.5;

1.1.4.5
date	99.03.24.02.54.52;	author hershey;	state Exp;
branches;
next	1.1.4.6;

1.1.4.6
date	99.03.26.00.08.02;	author hershey;	state Exp;
branches;
next	;

1.3.14.1
date	2002.04.02.20.57.58;	author hobbs;	state Exp;
branches;
next	;

1.3.16.1
date	2001.02.28.23.29.56;	author dgp;	state Exp;
branches;
next	;

1.4.2.1
date	2002.08.20.20.27.14;	author das;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Tk tests that create images need to be independent of the interpreter environment.
@
text
@# This file is a Tcl script to test drawing of menus in Tk.  It is
# organized in the standard fashion for Tcl tests.
#
# Copyright (c) 1996-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @@(#) $Id: menuDraw.test,v 1.11 2008/08/21 11:19:33 aniap Exp $

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
imageInit

test menuDraw-1.1 {TkMenuInitializeDrawingFields} -setup {
    deleteWindows
} -body {
    menu .m1
} -cleanup {
    deleteWindows
} -result {.m1}


test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-3.1 {TkMenuFreeDrawOptions} -setup {
    deleteWindows
} -body {
    menu .m1
    destroy .m1
} -result {}


test menuDraw-4.1 {TkMenuEntryFreeDrawOptions} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "This is a test"
    destroy .m1
} -result {}
test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add checkbutton -label "This is a test." -font "Courier 12" \
        -activeforeground red -background green -selectcolor purple
    destroy .m1
} -result {}


test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} -setup {
    deleteWindows
} -body {
    menu .m1
} -cleanup {
    deleteWindows
} -result {.m1}
test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 configure -fg red
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} -setup {
    deleteWindows
} -body {
    menu .m1 -disabledforeground ""
} -cleanup {
    deleteWindows
} -result {.m1}  


test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.2 {TkMenuConfigureEntryDrawOptions - tkfont specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -font "Courier 12"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.3 {TkMenuConfigureEntryDrawOptions - active state - wrong entry} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    .m1 entryconfigure 1 -state active
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.4 {TkMenuConfigureEntryDrawOptions - active state - correct entry} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    .m1 activate 1
    .m1 entryconfigure 1 -state active
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.5 {TkMenuConfigureEntryDrawOptions - deactivate entry} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    .m1 activate 1
    .m1 entryconfigure 1 -state normal
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.6 {TkMenuConfigureEntryDrawOptions - bad state} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    .m1 entryconfigure 1 -state foo
} -cleanup {
    deleteWindows
} -returnCodes error -result {bad state "foo": must be active, normal, or disabled}
test menuDraw-6.7 {TkMenuConfigureEntryDrawOptions - tkfont specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -font "Courier 12"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.8 {TkMenuConfigureEntryDrawOptions - border specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -background "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -foreground "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -activebackground "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -activeforeground "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add radiobutton -label "foo" -selectcolor "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.13 {TkMenuConfigureEntryDrawOptions - textGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -font "Helvetica 12"
    .m1 entryconfigure 1 -font "Courier 12"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -activeforeground "red"
    .m1 entryconfigure 1 -activeforeground "green"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1 -disabledforeground "red"
    .m1 add command -label "foo"
    .m1 configure -disabledforeground "green"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add radiobutton -label "foo" -selectcolor "red"
    .m1 entryconfigure 1 -selectcolor "green"
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-7.1 {TkEventuallyRecomputeMenu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "This is a long label"
    set tearoff [tk::TearOffMenu .m1]
    update idletasks
    .m1 entryconfigure 1 -label "foo"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "This is a long label"
    set tearoff [tk::TearOffMenu .m1]
    .m1 entryconfigure 1 -label "foo"
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-8.1 {TkRecomputeMenu} -constraints {
    win userInteraction
} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 configure -postcommand [.m1 add command -label foo]
    .m1 add command -label "Hit ESCAPE to make this menu go away."
    .m1 post 0 0
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} -setup {
    deleteWindows
} -body {
    catch {unset foo}
    menu .m1
    set foo 0
    .m1 add radiobutton -variable foo -label test
    tk::TearOffMenu .m1
    update idletasks
    list [set foo test] [destroy .m1] [unset foo]
} -result {test {} {}}
test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} -setup {
    deleteWindows
} -body {
    menu .m1
    tk::TearOffMenu .m1
} -cleanup {
    deleteWindows
} -returnCodes ok -match glob -result *


# Don't know how to test when window has been deleted and ComputeMenuGeometry
# gets called.
test menuDraw-10.1 {ComputeMenuGeometry - menubar} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label test
    . configure -menu .m1
    list [update idletasks] [. configure -menu ""]
} -cleanup {
    deleteWindows
} -result {{} {}}
test menuDraw-10.2 {ComputeMenuGeometry - non-menubar} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label test
    update idletasks
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-10.3 {ComputeMenuGeometry - Resize necessary} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label test
    update idletasks
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label test
    update idletasks
    .m1 entryconfigure 1 -label test
    update idletasks
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} -constraints {
    testImageType 
} -setup {
    deleteWindows
    imageCleanup
} -body {
    image create test image1
    image create test image2
    menu .m1
    .m1 add checkbutton -image image1 -selectimage image2
    .m1 invoke 1
    set tearoff [tk::TearOffMenu .m1 40 40]
    update idletasks
    list [image delete image2] [destroy .m1]
} -cleanup {
    imageCleanup
} -result {{} {}}
test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} -constraints {
    testImageType 
} -setup {
    deleteWindows
    imageCleanup
} -body {
    image create test image1
    image create test image2
    menu .m1
    .m1 add checkbutton -image image1 -selectimage image2
    .m1 invoke 1
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [image delete image2] [destroy .m1]
} -cleanup {
    imageCleanup
} -result {{} {}}
test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} -constraints {
    testImageType 
} -setup {
    deleteWindows
    imageCleanup
} -body {
    image create test image1
    image create test image2
    menu .m1
    .m1 add checkbutton -image image1 -selectimage image2
    set tearoff [tk::TearOffMenu .m1 40 40]
    update idletasks
    list [image delete image2] [destroy .m1]
} -cleanup {
    imageCleanup
} -result {{} {}}

#Don't know how to test missing tkwin in DisplayMenu
test menuDraw-12.1 {DisplayMenu - menubar background} -constraints unix -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label foo -menu .m2
    . configure -menu .m1
    list [update] [. configure -menu ""]
} -cleanup {
    deleteWindows
} -result {{} {}}
test menuDraw-12.2 {Display menu - no entries} -setup {
    deleteWindows
} -body {
    menu .m1
    set tearoff [tk::TearOffMenu .m1 40 40]
    update
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-12.3 {DisplayMenu - one entry} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label foo
    set tearoff [tk::TearOffMenu .m1 40 40]
    update
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-12.4 {DisplayMenu - two entries} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "one"
    .m1 add command -label "two"
    set tearoff [tk::TearOffMenu .m1 40 40]
    update
} -cleanup {
    deleteWindows
} -result {}
test menuDraw.12.5 {DisplayMenu - two columns - first bigger} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "one"
    .m1 add command -label "two"
    .m1 add command -label "three" -columnbreak 1
    set tearoff [tk::TearOffMenu .m1 40 40]
    update
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-12.5 {DisplayMenu - two column - second  bigger} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "one"
    .m1 add command -label "two" -columnbreak 1
    .m1 add command -label "three"
    set tearoff [tk::TearOffMenu .m1 40 40]
    update
} -cleanup {
    deleteWindows
} -result {}
test menuDraw.12.7 {DisplayMenu - three columns} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "one"
    .m1 add command -label "two" -columnbreak 1
    .m1 add command -label "three"
    .m1 add command -label "four"
    .m1 add command -label "five"
    .m1 add command -label "six"
    set tearoff [tk::TearOffMenu .m1 40 40]
    update
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-12.6 {Display menu - testing for extra space and menubars} -constraints {
    unix 
} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label foo
    . configure -menu .m1
    update
    . configure -menu ""
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-12.7 {Display menu - extra space at end of menu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label foo
    set tearoff [tk::TearOffMenu .m1 40 40]
    wm geometry $tearoff 200x100
    update
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-13.1 {TkMenuEventProc - Expose} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "one"
    menu .m2
    .m2 add command -label "two"
    set tearoff1 [tk::TearOffMenu .m1 40 40]
    set tearoff2 [tk::TearOffMenu .m2 40 40]
    list [raise $tearoff2] [update]
} -cleanup {
    deleteWindows
} -result {{} {}}
test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [wm geometry $tearoff 200x100] [update]
} -cleanup {
    deleteWindows
} -result {{} {}}
# Testing deletes is hard, and I am going to do my best. Don't know how
# to test the case where we have already cleared the tkwin field in the
# menuPtr.
test menuDraw-13.4 {TkMenuEventProc - simple delete} -setup {
    deleteWindows
} -body {
    menu .m1
    destroy .m1
} -result {}
test menuDraw-13.5 {TkMenuEventProc - nothing pending} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label foo
    update idletasks
    destroy .m1
} -result {}


test menuDraw-14.1 {TkMenuImageProc} -constraints testImageType -setup {
    deleteWindows
} -body {
    catch {image delete image1}
    menu .m1
    image create test image1
    .m1 add command -image image1
    update idletasks
    image delete image1
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-14.2 {TkMenuImageProc} -constraints testImageType -setup {
    deleteWindows
} -body {
    catch {image delete image1}
    menu .m1
    image create test image1
    .m1 add command -image image1
    image delete image1
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    tk::TearOffMenu .m1 40 40
} -cleanup {
    deleteWindows
} -returnCodes ok -match glob -result *
test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -state active
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff index active
} -cleanup {
    deleteWindows
} -result {none}
test menuDraw-15.3 {TkPostTearoffMenu - post command} -setup {
    deleteWindows
} -body {
    catch {unset foo}
    menu .m1 -postcommand "set foo .m1"
    .m1 add command -label "foo"
    list [catch {tk::TearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1]
} -result {0 .m1 {} {}}
test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} -setup {
    deleteWindows
} -body {
    menu .m1 -postcommand "destroy .m1"
    .m1 add command -label "foo"
    list [catch {tk::TearOffMenu .m1 40 40} msg] $msg [winfo exists .m1]
} -result {0 {} 0}
test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    set height [winfo screenheight .m1]
    tk::TearOffMenu .m1 40 $height
} -cleanup {
    deleteWindows
} -returnCodes ok -match glob -result *
test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo"
    set width [winfo screenwidth .m1]
    tk::TearOffMenu .m1 $width 40
} -cleanup {
    deleteWindows
} -returnCodes ok -match glob -result *


test menuDraw-16.1 {TkPostSubmenu} -constraints nonUnixUserInteraction -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label test -menu .m2
    menu .m2
    .m2 add command -label "Hit ESCAPE to make this menu go away."
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff postcascade 0
    $tearoff postcascade 0
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-16.2 {TkPostSubMenu} -constraints nonUnixUserInteraction -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label "two" -menu .m2
    .m1 add cascade -label "three" -menu .m3
    menu .m2
    .m2 add command -label "two"
    menu .m3
    .m3 add command -label "three"
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff postcascade 0
    $tearoff postcascade 1
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-16.3 {TkPostSubMenu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label test -menu .m2
    .m1 postcascade 1
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-16.4 {TkPostSubMenu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label test
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff postcascade 0
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-16.5 {TkPostSubMenu} -constraints unix -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label test -menu .m2
    menu .m2 -postcommand "glorp"
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff postcascade test
} -cleanup {
    deleteWindows
} -returnCodes error -result {invalid command name "glorp"}
test menuDraw-16.6 {TkPostSubMenu} -constraints {
    win userInteraction
} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label test -menu .m2
    menu .m2
    .m2 add command -label "Hit ESCAPE to get rid of this menu"
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff postcascade 0 
} -cleanup {
    deleteWindows
} -result {}


test menuDraw-17.1 {AdjustMenuCoords - menubar} -constraints unix -setup {
    deleteWindows
} -body {
    menu .m1 -tearoff 0
    .m1 add cascade -label test -menu .m2
    menu .m2 -tearoff 0
    .m2 add command -label foo
    . configure -menu .m1
    foreach w [winfo children .] {
        if {[$w cget -type] == "menubar"} {
            break
        }
    }
    list [$w postcascade 0] [. configure -menu ""]
} -cleanup {
    deleteWindows
} -result {{} {}}
test menuDraw-17.2 {AdjustMenuCoords - menu} -constraints {
    win userInteraction
} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add cascade -label test -menu .m2
    menu .m2
    .m2 add command -label "Hit ESCAPE to make this menu go away"
    set tearoff [tk::TearOffMenu .m1 40 40]
    $tearoff postcascade 0
} -cleanup {
    deleteWindows
} -result {}

# cleanup
imageFinish
deleteWindows
cleanupTests
return

# Local variables:
# mode: tcl
# End:
@


1.11
log
@Update to tcltest2
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.10 2007/05/09 12:52:44 das Exp $
d14 1
d329 1
a329 1
    eval image delete [image names]
d338 4
a341 2
    list [image delete image2] [destroy .m1] [eval image delete [image names]]
} -result {{} {} {}}
d346 1
a346 1
    catch {eval image delete [image names]}
d354 4
a357 2
    list [image delete image2] [destroy .m1] [eval image delete [image names]]
} -result {{} {} {}}
d362 1
a362 1
    catch {eval image delete [image names]}
d370 4
a373 2
    list [image delete image2] [destroy .m1] [eval image delete [image names]]
} -result {{} {} {}}
d712 1
d717 3
@


1.10
log
@	* tests/constraints.tcl: ensure 'nonUnixUserInteraction' constraint is
				 set for aqua.

	* tests/choosedir.test:	add 'notAqua' constraints to X11-only tests;
	* tests/clrpick.test:	add 'nonUnixUserInteraction' to 'unix' tests
	* tests/menuDraw.test:	requiring interaction on aqua.
	* tests/unixMenu.test:
	* tests/unixWm.test:
	* tests/winMenu.test:
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.9 2004/06/24 12:45:43 dkf Exp $
d10 1
a10 1
package require tcltest 2.1
d13 9
a22 4
test menuDraw-1.1 {TkMenuInitializeDrawingFields} {
    catch {destroy .m1}
    list [menu .m1] [destroy .m1]
} {.m1 {}}
d24 3
a26 2
test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} {
    catch {destroy .m1}
d28 4
a31 2
    list [.m1 add command] [destroy .m1]
} {{} {}}
d33 4
a36 2
test menuDraw-3.1 {TkMenuFreeDrawOptions} {
    catch {destroy .m1}
d38 3
a40 2
    list [destroy .m1]
} {{}}
d42 3
a44 2
test menuDraw-4.1 {TkMenuEntryFreeDrawOptions} {
    catch {destroy .m1}
d47 64
a110 41
    list [destroy .m1]
} {{}}
test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} {
	catch {destroy .m1}
	menu .m1
	.m1 add checkbutton -label "This is a test." -font "Courier 12" -activeforeground red -background green -selectcolor purple
	list [destroy .m1]
} {{}}

test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} {
    catch {destroy .m1}
    list [menu .m1] [destroy .m1]
} {.m1 {}}
test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} {
    catch {destroy .m1}
    menu .m1
    list [.m1 configure -fg red] [destroy .m1]
} {{} {}}
test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} {
	catch {destroy .m1}
	list [menu .m1 -disabledforeground ""] [destroy .m1]
} {.m1 {}}	

test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo"] [destroy .m1]
} {{} {}}
test menuDraw-6.2 {TkMenuConfigureEntryDrawOptions - tkfont specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo" -font "Courier 12"] [destroy .m1]
} {{} {}}
test menuDraw-6.3 {TkMenuConfigureEntryDrawOptions - active state - wrong entry} {
    catch {destroy .m1}
    menu .m1
    .m1 add command -label "foo"
    list [.m1 entryconfigure 1 -state active] [destroy .m1]
} {{} {}}
test menuDraw-6.4 {TkMenuConfigureEntryDrawOptions - active state - correct entry} {
    catch {destroy .m1}
d114 7
a120 4
    list [.m1 entryconfigure 1 -state active] [destroy .m1]
} {{} {}}
test menuDraw-6.5 {TkMenuConfigureEntryDrawOptions - deactivate entry} {
    catch {destroy .m1}
d124 64
a187 40
    list [.m1 entryconfigure 1 -state normal] [destroy .m1]
} {{} {}}
test menuDraw-6.6 {TkMenuConfigureEntryDrawOptions - bad state} {
    catch {destroy .m1}
    menu .m1
    .m1 add command -label "foo"
    list [catch {.m1 entryconfigure 1 -state foo} msg] $msg [destroy .m1]
} {1 {bad state "foo": must be active, normal, or disabled} {}}
test menuDraw-6.7 {TkMenuConfigureEntryDrawOptions - tkfont specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo" -font "Courier 12"] [destroy .m1]
} {{} {}}
test menuDraw-6.8 {TkMenuConfigureEntryDrawOptions - border specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo" -background "red"] [destroy .m1]
} {{} {}}
test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo" -foreground "red"] [destroy .m1]
} {{} {}}
test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo" -activebackground "red"] [destroy .m1]
} {{} {}}
test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add command -label "foo" -activeforeground "red"] [destroy .m1]
} {{} {}}
test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} {
    catch {destroy .m1}
    menu .m1
    list [.m1 add radiobutton -label "foo" -selectcolor "red"] [destroy .m1]
} {{} {}}
test menuDraw-6.13 {TkMenuConfigureEntryDrawOptions - textGC disposal} {
    catch {destroy .m1}
d190 7
a196 4
    list [.m1 entryconfigure 1 -font "Courier 12"] [destroy .m1]
} {{} {}}
test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} {
    catch {destroy .m1}
d199 7
a205 4
    list [.m1 entryconfigure 1 -activeforeground "green"] [destroy .m1]
} {{} {}}
test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} {
    catch {destroy .m1}
d208 7
a214 4
    list [.m1 configure -disabledforeground "green"] [destroy .m1]
} {{} {}}
test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} {
    catch {destroy .m1}
d217 4
a220 2
    list [.m1 entryconfigure 1 -selectcolor "green"] [destroy .m1]
} {{} {}}
d222 4
a225 2
test menuDraw-7.1 {TkEventuallyRecomputeMenu} {
    catch {destroy .m1}
d230 7
a236 4
    list [.m1 entryconfigure 1 -label "foo"] [destroy .m1]
} {{} {}}
test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} {
    catch {destroy .m1}
d240 4
a243 2
    list [.m1 entryconfigure 1 -label "foo"] [destroy .m1]
} {{} {}}
d246 5
a250 2
test menuDraw-8.1 {TkRecomputeMenu} {win userInteraction} {
    catch {destroy .m1}
d254 4
a257 2
    list [.m1 post 0 0] [destroy .m1]
} {{} {}}
d260 3
a262 2
test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} {
    catch {destroy .m1}
d270 4
a273 3
} {test {} {}}
test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} {
    catch {destroy .m1}
d275 5
a279 2
    list [catch {tk::TearOffMenu .m1}] [destroy .m1]
} {0 {}}
d283 3
a285 2
test menuDraw-10.1 {ComputeMenuGeometry - menubar} {
    catch {destroy .m1}
d289 7
a295 4
    list [update idletasks] [. configure -menu ""] [destroy .m1]
} {{} {} {}}
test menuDraw-10.2 {ComputeMenuGeometry - non-menubar} {
    catch {destroy .m1}
d298 7
a304 4
    list [update idletasks] [destroy .m1]
} {{} {}}
test menuDraw-10.3 {ComputeMenuGeometry - Resize necessary} {
    catch {destroy .m1}
d307 7
a313 4
    list [update idletasks] [destroy .m1]
} {{} {}}
test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} {
    catch {destroy .m1}
d318 5
a322 2
    list [update idletasks] [destroy .m1]
} {{} {}}
d324 6
a329 3
test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} testImageType {
    catch {destroy .m1}
    catch {eval image delete [image names]}
d338 5
a342 3
} {{} {} {}}
test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} testImageType {
    catch {destroy .m1}
d344 1
d352 5
a356 3
} {{} {} {}}
test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} testImageType {
    catch {destroy .m1}
d358 1
d366 1
a366 1
} {{} {} {}}
d369 3
a371 2
test menuDraw-12.1 {DisplayMenu - menubar background} unix {
    catch {destroy .m1}
d375 16
a390 10
    list [update] [. configure -menu ""] [destroy .m1]
} {{} {} {}}
test menuDraw-12.2 {Display menu - no entries} {
    catch {destroy .m1}
    menu .m1
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.3 {DisplayMenu - one entry} {
    catch {destroy .m1}
d394 7
a400 4
    list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.4 {DisplayMenu - two entries} {
    catch {destroy .m1}
d405 7
a411 4
    list [update] [destroy .m1]
} {{} {}}
test menuDraw.12.5 {DisplayMenu - two columns - first bigger} {
    catch {destroy .m1}
d417 7
a423 4
    list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.5 {DisplayMenu - two column - second  bigger} {
    catch {destroy .m1}
d429 7
a435 4
    list [update] [destroy .m1]
} {{} {}}
test menuDraw.12.7 {DisplayMenu - three columns} {
    catch {destroy .m1}
d444 9
a452 4
    list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.6 {Display menu - testing for extra space and menubars} unix {
    catch {destroy .m1}
d456 8
a463 4
    list [update] [. configure -menu ""] [destroy .m1]
} {{} {} {}}
test menuDraw-12.7 {Display menu - extra space at end of menu} {
    catch {destroy .m1}
d468 5
a472 2
    list [update] [destroy .m1]
} {{} {}}
d474 3
a476 3
test menuDraw-13.1 {TkMenuEventProc - Expose} {
    catch {destroy .m1}
    catch {destroy .m2}
d483 7
a489 4
    list [raise $tearoff2] [update] [destroy .m1] [destroy .m2]
} {{} {} {} {}}
test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} {
    catch {destroy .m1}
d493 4
a496 2
    list [wm geometry $tearoff 200x100] [update] [destroy .m1]
} {{} {} {}}
d500 9
a508 7
test menuDraw-13.4 {TkMenuEventProc - simple delete} {
    catch {destroy .m1}
    menu .m1
    list [destroy .m1]
} {{}}
test menuDraw-13.5 {TkMenuEventProc - nothing pending} {
    catch {destroy .m1}
d512 3
a514 2
    list [destroy .m1]
} {{}}
d516 3
a518 2
test menuDraw-14.1 {TkMenuImageProc} testImageType {
    catch {destroy .m1}
d524 7
a530 4
    list [image delete image1] [destroy .m1]
} {{} {}}
test menuDraw-14.2 {TkMenuImageProc} testImageType {
    catch {destroy .m1}
d535 18
a552 11
    list [image delete image1] [destroy .m1]
} {{} {}}

test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} {
    catch {destroy .m1}
    menu .m1
    .m1 add command -label "foo"
    list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} {
    catch {destroy .m1}
d556 7
a562 4
    list [$tearoff index active] [destroy .m1]
} {none {}}
test menuDraw-15.3 {TkPostTearoffMenu - post command} {
    catch {destroy .m1}
d567 4
a570 3
} {0 .m1 {} {}}
test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} {
    catch {destroy .m1}
d574 4
a577 3
} {0 {} 0}
test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} {
    catch {destroy .m1}
d581 7
a587 4
    list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1]
} {0 {}}
test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} {
    catch {destroy .m1}
d591 4
a594 2
    list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1]
} {0 {}}
d597 3
a599 3
test menuDraw-16.1 {TkPostSubmenu} nonUnixUserInteraction {
    catch {destroy .m1}
    catch {destroy .m2}
d606 7
a612 6
    list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
} {{} {} {}}
test menuDraw-16.2 {TkPostSubMenu} nonUnixUserInteraction {
    catch {destroy .m1}
    catch {destroy .m2}
    catch {destroy .m3}
d622 7
a628 4
    list [$tearoff postcascade 1] [destroy .m1] [destroy .m2] [destroy .m3]
} {{} {} {} {}}
test menuDraw-16.3 {TkPostSubMenu} {
    catch {destroy .m1}
d631 7
a637 4
    list [.m1 postcascade 1] [destroy .m1]
} {{} {}}
test menuDraw-16.4 {TkPostSubMenu} {
    catch {destroy .m1}
d641 7
a647 5
    list [$tearoff postcascade 0] [destroy .m1]
} {{} {}}
test menuDraw-16.5 {TkPostSubMenu} unix {
    catch {destroy .m1}
    catch {destroy .m2}
d652 9
a660 5
    list [catch {$tearoff postcascade test} msg] $msg [destroy .m1] [destroy .m2]
} {1 {invalid command name "glorp"} {} {}}
test menuDraw-16.6 {TkPostSubMenu} {win userInteraction} {
    catch {destroy .m1}
    catch {destroy .m2}
d666 4
a669 2
    list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
} {{} {} {}}
d671 4
a674 3
test menuDraw-17.1 {AdjustMenuCoords - menubar} unix {
    catch {destroy .m1}
    catch {destroy .m2}
d681 3
a683 3
	if {[$w cget -type] == "menubar"} {
		break
	}
d685 9
a693 5
    list [$w postcascade 0] [. configure -menu ""] [destroy .m1] [destroy .m2]
} {{} {} {} {}}
test menuDraw-17.2 {AdjustMenuCoords - menu} {win userInteraction} {
    catch {destroy .m1}
    catch {destroy .m2}
d699 4
a702 2
    list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
} {{} {} {}}
d708 1
@


1.9
log
@Use standard constraint names
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.8 2004/05/23 17:34:48 dkf Exp $
d425 1
a425 1
test menuDraw-16.1 {TkPostSubmenu} unix {
d436 1
a436 1
test menuDraw-16.2 {TkPostSubMenu} unix {
@


1.8
log
@First step towards improving test style.  Also start using Tcl 8.5 features.
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.7 2004/03/17 18:15:49 das Exp $
d166 1
a166 1
test menuDraw-8.1 {TkRecomputeMenu} {pcOnly userInteraction} {
d257 1
a257 1
test menuDraw-12.1 {DisplayMenu - menubar background} {unixOnly} {
d315 1
a315 1
test menuDraw-12.6 {Display menu - testing for extra space and menubars} {unixOnly} {
d425 1
a425 1
test menuDraw-16.1 {TkPostSubmenu} {unixOnly} {
d436 1
a436 1
test menuDraw-16.2 {TkPostSubMenu} {unixOnly} {
d464 1
a464 1
test menuDraw-16.5 {TkPostSubMenu} {unixOnly} {
d473 1
a473 1
test menuDraw-16.6 {TkPostSubMenu} {pcOnly userInteraction} {
d484 1
a484 1
test menuDraw-17.1 {AdjustMenuCoords - menubar} {unixOnly} {
d499 1
a499 1
test menuDraw-17.2 {AdjustMenuCoords - menu} {pcOnly userInteraction} {
@


1.7
log
@Removed support for Mac OS Classic platform [Patch 918139]
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.6 2003/04/01 21:06:43 dgp Exp $
a513 13













@


1.6
log
@        * tests/all.tcl:                Made better use of a common
        * tests/constraints.tcl:        -loadfile to hold definitions
        * tests/*.test:                 common to all test files.
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.5 2002/07/13 20:28:35 dgp Exp $
a348 8
test menuDraw-13.3 {TkMenuEventProc - ActivateNotify} {macOnly} {
    catch {destroy .t2}
    toplevel .t2 -menu .t2.m1
    menu .t2.m1
    .t2.m1 add command -label foo
    tk::TearOffMenu .t2.m1 40 40
    list [catch {update} msg] $msg [destroy .t2]
} {0 {} {}}
@


1.5
log
@	* Converted more files to tcltest and factored out common code.
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.4 2001/08/01 16:21:12 dgp Exp $
d11 1
a11 4
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
d520 1
a520 1
::tcltest::cleanupTests
@


1.4
log
@	Merged changes from feature branch dgp-privates-into-namespace,
	implementing TIP 44.  All Tk commands and variables matching
	tk[A-Z]* are now in the ::tk namespace.
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.3 1999/04/16 01:51:39 stanton Exp $
d10 6
a15 21
if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}

if {[lsearch [image types] test] < 0} {
    puts "This application hasn't been compiled with the \"test\" image"
    puts "type, so I can't run this test.  Are you sure you're using"
    puts "tktest instead of wish?"
    ::tcltest::cleanupTests
    return
}

proc deleteWindows {} {
    foreach i [winfo children .] {
    	catch [destroy $i]
    }
}

deleteWindows
wm geometry . {}
raise .
d224 1
a224 1
test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} {
d236 1
a236 1
test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} {
d247 1
a247 1
test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} {
d376 1
a376 1
test menuDraw-14.1 {TkMenuImageProc} {
d385 1
a385 1
test menuDraw-14.2 {TkMenuImageProc} {
@


1.4.2.1
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d8 1
a8 1
# RCS: @@(#) $Id$
d10 21
a30 6
package require tcltest 2.1
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands
d239 1
a239 1
test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} testImageType {
d251 1
a251 1
test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} testImageType {
d262 1
a262 1
test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} testImageType {
d391 1
a391 1
test menuDraw-14.1 {TkMenuImageProc} testImageType {
d400 1
a400 1
test menuDraw-14.2 {TkMenuImageProc} testImageType {
@


1.3
log
@* Merged 8.1 branch into the main trunk
@
text
@d8 1
a8 1
# RCS: @@(#) $Id$
d171 1
a171 1
    set tearoff [tkTearOffMenu .m1]
d179 1
a179 1
    set tearoff [tkTearOffMenu .m1]
d199 1
a199 1
    tkTearOffMenu .m1
d206 1
a206 1
    list [catch {tkTearOffMenu .m1}] [destroy .m1]
d247 1
a247 1
    set tearoff [tkTearOffMenu .m1 40 40]
d259 1
a259 1
    set tearoff [tkTearOffMenu .m1 40 40]
d269 1
a269 1
    set tearoff [tkTearOffMenu .m1 40 40]
d285 1
a285 1
    set tearoff [tkTearOffMenu .m1 40 40]
d292 1
a292 1
    set tearoff [tkTearOffMenu .m1 40 40]
d300 1
a300 1
    set tearoff [tkTearOffMenu .m1 40 40]
d309 1
a309 1
    set tearoff [tkTearOffMenu .m1 40 40]
d318 1
a318 1
    set tearoff [tkTearOffMenu .m1 40 40]
d330 1
a330 1
    set tearoff [tkTearOffMenu .m1 40 40]
d344 1
a344 1
    set tearoff [tkTearOffMenu .m1 40 40]
d356 2
a357 2
    set tearoff1 [tkTearOffMenu .m1 40 40]
    set tearoff2 [tkTearOffMenu .m2 40 40]
d364 1
a364 1
    set tearoff [tkTearOffMenu .m1 40 40]
d372 1
a372 1
    tkTearOffMenu .t2.m1 40 40
d413 1
a413 1
    list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
d419 1
a419 1
    set tearoff [tkTearOffMenu .m1 40 40]
d427 1
a427 1
    list [catch {tkTearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1]
d433 1
a433 1
    list [catch {tkTearOffMenu .m1 40 40} msg] $msg [winfo exists .m1]
d440 1
a440 1
    list [catch {tkTearOffMenu .m1 40 $height}] [destroy .m1]
d447 1
a447 1
    list [catch {tkTearOffMenu .m1 $width 40}] [destroy .m1]
d458 1
a458 1
    set tearoff [tkTearOffMenu .m1 40 40]
d473 1
a473 1
    set tearoff [tkTearOffMenu .m1 40 40]
d487 1
a487 1
    set tearoff [tkTearOffMenu .m1 40 40]
d496 1
a496 1
    set tearoff [tkTearOffMenu .m1 40 40]
d506 1
a506 1
    set tearoff [tkTearOffMenu .m1 40 40]
d532 1
a532 1
    set tearoff [tkTearOffMenu .m1 40 40]
@


1.3.14.1
log
@sync with head
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.4 2001/08/01 16:21:12 dgp Exp $
d171 1
a171 1
    set tearoff [tk::TearOffMenu .m1]
d179 1
a179 1
    set tearoff [tk::TearOffMenu .m1]
d199 1
a199 1
    tk::TearOffMenu .m1
d206 1
a206 1
    list [catch {tk::TearOffMenu .m1}] [destroy .m1]
d247 1
a247 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d259 1
a259 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d269 1
a269 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d285 1
a285 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d292 1
a292 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d300 1
a300 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d309 1
a309 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d318 1
a318 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d330 1
a330 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d344 1
a344 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d356 2
a357 2
    set tearoff1 [tk::TearOffMenu .m1 40 40]
    set tearoff2 [tk::TearOffMenu .m2 40 40]
d364 1
a364 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d372 1
a372 1
    tk::TearOffMenu .t2.m1 40 40
d413 1
a413 1
    list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
d419 1
a419 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d427 1
a427 1
    list [catch {tk::TearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1]
d433 1
a433 1
    list [catch {tk::TearOffMenu .m1 40 40} msg] $msg [winfo exists .m1]
d440 1
a440 1
    list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1]
d447 1
a447 1
    list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1]
d458 1
a458 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d473 1
a473 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d487 1
a487 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d496 1
a496 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d506 1
a506 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d532 1
a532 1
    set tearoff [tk::TearOffMenu .m1 40 40]
@


1.3.16.1
log
@2001-02-28  Don Porter  <dgp@@users.sourceforge.net>

        BRANCH dgp-privates-into-namespace:  Feature branch to move all
        of Tk's private commands and variable into the ::tk namespace
        and its children.

        * doc/tkvars.n:  Documented private variable tkPriv renamed tk::Priv.

        * generic/tkBind.c:
        * generic/tkMenu.c:
        * generic/tkTextDisp.c:
        * library/bgerror.tcl:
        * library/button.tcl:
        * library/choosedir.tcl:
        * library/clrpick.tcl:
        * library/comdlg.tcl:
        * library/console.tcl:
        * library/dialog.tcl:
        * library/entry.tcl:
        * library/focus.tcl:
        * library/listbox.tcl:
        * library/menu.tcl:
        * library/msgbox.tcl:
        * library/optMenu.tcl:
        * library/palette.tcl:
        * library/scale.tcl:
        * library/scrlbar.tcl:
        * library/spinbox.tcl:
        * library/tclIndex:
        * library/tearoff.tcl:
        * library/text.tcl:
        * library/tk.tcl:
        * library/tkfbox.tcl:
        * library/xmfbox.tcl:
        * mac/tkMacMenu.c:
        * tests/clrpick.test:
        * tests/filebox.test:
        * tests/macMenu.test:
        * tests/menu.test:
        * tests/menuDraw.test:
        * tests/msgbox.test:
        * tests/text.test:
        * tests/textDisp.test:
        * tests/unixMenu.test:
        * tests/winMenu.test:
        * tests/xmfbox.test:
        * unix/tkUnixDialog.c:  All Tk commands matching ::tk[A-Z]* and
        all Tk private variables in the global namespace were renamed to
        live in the namespace ::tk or one of its children.
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.3 1999/04/16 01:51:39 stanton Exp $
d171 1
a171 1
    set tearoff [tk::TearOffMenu .m1]
d179 1
a179 1
    set tearoff [tk::TearOffMenu .m1]
d199 1
a199 1
    tk::TearOffMenu .m1
d206 1
a206 1
    list [catch {tk::TearOffMenu .m1}] [destroy .m1]
d247 1
a247 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d259 1
a259 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d269 1
a269 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d285 1
a285 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d292 1
a292 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d300 1
a300 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d309 1
a309 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d318 1
a318 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d330 1
a330 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d344 1
a344 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d356 2
a357 2
    set tearoff1 [tk::TearOffMenu .m1 40 40]
    set tearoff2 [tk::TearOffMenu .m2 40 40]
d364 1
a364 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d372 1
a372 1
    tk::TearOffMenu .t2.m1 40 40
d413 1
a413 1
    list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
d419 1
a419 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d427 1
a427 1
    list [catch {tk::TearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1]
d433 1
a433 1
    list [catch {tk::TearOffMenu .m1 40 40} msg] $msg [winfo exists .m1]
d440 1
a440 1
    list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1]
d447 1
a447 1
    list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1]
d458 1
a458 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d473 1
a473 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d487 1
a487 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d496 1
a496 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d506 1
a506 1
    set tearoff [tk::TearOffMenu .m1 40 40]
d532 1
a532 1
    set tearoff [tk::TearOffMenu .m1 40 40]
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d5 2
a6 3
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d10 4
d18 1
a21 4
if {[info procs test] != "test"} {
    source defs
}

a31 10
if {$tcl_platform(platform) == "windows" && ![info exists INTERACTIVE]} {
    puts " Some tests were skipped because they could not be performed"
    puts " automatically on this platform. If you wish to execute them"
    puts " interactively, set the TCL variable INTERACTIVE and re-run"
    puts " the test."
    set testConfig(menuInteractive) 0
} else {
    set testConfig(menuInteractive) 1
}

d111 1
a111 1
} {1 {bad state value "foo": must be normal, active, or disabled} {}}
d184 1
a184 1
test menuDraw-8.1 {TkRecomputeMenu} {menuInteractive} {
d499 1
a499 1
test menuDraw-16.6 {TkPostSubMenu} {menuInteractive} {
d525 1
a525 1
test menuDraw-17.2 {AdjustMenuCoords - menu} {menuInteractive} {
d536 1
d538 15
@


1.1
log
@Initial revision
@
text
@d9 1
a9 1
# SCCS: @@(#) menuDraw.test 1.11 97/06/24 13:50:34
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d9 1
a9 1
# SCCS: @@(#) menuDraw.test 1.15 97/12/23 08:58:07
d121 1
a121 1
} {1 {bad state "foo": must be active, normal, or disabled} {}}
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: menuDraw.test,v 1.2 1998/09/14 18:23:48 stanton Exp $
@


1.1.4.3
log
@Updated the testsuite to use "test" namespace and commandline args
to control verbose  level and which tests get run.  Tests now work from
any working dir.
@
text
@a4 2
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
d6 4
a9 1
# RCS: @@(#) $Id: menuDraw.test,v 1.1.4.2 1998/09/30 02:18:48 stanton Exp $
d18 2
a19 2
if {[lsearch [namespace children] ::test] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
d37 1
a37 1
    set ::test::testConfig(menuInteractive) 0
d39 1
a39 1
    set ::test::testConfig(menuInteractive) 1
a545 1
# cleanup
a546 2
::test::cleanupTests
return
@


1.1.4.4
log
@- changed ::test to ::tcltest
- made many tests more atomic (still more work to do here)
- defs.tcl is now identicle for tcl and tk
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.1.4.3 1999/03/11 18:51:00 hershey Exp $
d17 1
a17 1
if {[lsearch [namespace children] ::tcltest] == -1} {
d31 10
d193 1
a193 1
test menuDraw-8.1 {TkRecomputeMenu} {pcOnly interactive} {
d508 1
a508 1
test menuDraw-16.6 {TkPostSubMenu} {pcOnly interactive} {
d534 1
a534 1
test menuDraw-17.2 {AdjustMenuCoords - menu} {pcOnly interactive} {
d547 1
a547 1
::tcltest::cleanupTests
a548 12












@


1.1.4.5
log
@lint:  changed a tcltest namespace variable name from tmpDir to
       workingDir.
changes:  made more tests atomic.
README is now updated to match new test suite features.
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: menuDraw.test,v 1.1.4.4 1999/03/24 01:16:57 hershey Exp $
a538 1

@


1.1.4.6
log
@Now all test files that skip tests by returning early (which ideally they
shouldn't do) call ::tcltest::cleanupTests before returning.  The defs.tcl
file has one hew constraint:  userInteraction, used by tests that require
user interaction.  The next putback will include an updated version of the
"visual" test file to use this mechanism.
@
text
@d8 1
a8 5
# RCS: @@(#) $Id: menuDraw.test,v 1.1.4.5 1999/03/24 02:54:52 hershey Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}
a13 1
    ::tcltest::cleanupTests
d17 4
d183 1
a183 1
test menuDraw-8.1 {TkRecomputeMenu} {pcOnly userInteraction} {
d498 1
a498 1
test menuDraw-16.6 {TkPostSubMenu} {pcOnly userInteraction} {
d524 1
a524 1
test menuDraw-17.2 {AdjustMenuCoords - menu} {pcOnly userInteraction} {
@


