summaryrefslogtreecommitdiffstats
path: root/tests/unixWm.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unixWm.test')
-rw-r--r--tests/unixWm.test500
1 files changed, 289 insertions, 211 deletions
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 60cd9d9..d579fc7 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -8,15 +8,10 @@
# All rights reserved.
package require tcltest 2.2
-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]
+eval tcltest::configure $argv
tcltest::loadTestedCommands
-namespace import -force tcltest::interpreter
-namespace import -force tcltest::makeFile
-namespace import -force tcltest::removeFile
+namespace import -force ::tk::test:loadTkCommand
proc sleep ms {
global x
@@ -37,7 +32,7 @@ proc makeToplevels {} {
set i 1
foreach geom {+20+80 +80+20 +0+0} {
- catch {destroy .t}
+ destroy .t
test unixWm-1.$i {initial window position} unix {
toplevel .t -width 200 -height 150
wm geom .t $geom
@@ -53,7 +48,7 @@ foreach geom {+20+80 +80+20 +0+0} {
# this just makes sure that things are consistent between moves.
set i 1
-catch {destroy .t}
+destroy .t
toplevel .t -width 100 -height 150
wm geom .t +200+200
update
@@ -102,7 +97,7 @@ foreach geom {+20+80 +100+40 +0+0} {
}
test unixWm-5.1 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -111,7 +106,7 @@ test unixWm-5.1 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {1 normal}
test unixWm-5.2 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -121,7 +116,7 @@ test unixWm-5.2 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {0 withdrawn}
test unixWm-5.3 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -132,7 +127,7 @@ test unixWm-5.3 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {1 normal}
test unixWm-5.4 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -142,7 +137,7 @@ test unixWm-5.4 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {0 iconic}
test unixWm-5.5 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -151,7 +146,7 @@ test unixWm-5.5 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {0 withdrawn}
test unixWm-5.6 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -161,7 +156,7 @@ test unixWm-5.6 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {1 normal}
test unixWm-5.7 {compounded state changes} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 100
wm geometry .t +100+100
update
@@ -170,7 +165,7 @@ test unixWm-5.7 {compounded state changes} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {0 iconic}
-catch {destroy .t}
+destroy .t
toplevel .t -width 200 -height 100
wm geom .t +10+10
wm minsize .t 1 1
@@ -221,7 +216,7 @@ test unixWm-6.4 {size changes} {unix nonPortable userInteraction} {
sleep 200
test unixWm-6.5 {window initially iconic} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 30
wm geometry .t +0+0
wm title .t 2
@@ -232,7 +227,7 @@ test unixWm-6.5 {window initially iconic} {unix nonPortable} {
list [winfo ismapped .t] [wm state .t]
} {1 normal}
-catch {destroy .m}
+destroy .m
toplevel .m
wm overrideredirect .m 1
foreach i {{Test label} Another {Yet another} {Last label}} j {1 2 3} {
@@ -253,11 +248,11 @@ test unixWm-7.3 {override_redirect and Tk_MoveTopLevelWindow} unix {
list [winfo ismapped .m]
} 0
destroy .m
-catch {destroy .t}
+destroy .t
test unixWm-8.1 {icon windows} unix {
- catch {destroy .t}
- catch {destroy .icon}
+ destroy .t
+ destroy .icon
toplevel .t -width 100 -height 30
wm geometry .t +0+0
toplevel .icon -width 50 -height 50 -bg red
@@ -265,18 +260,18 @@ test unixWm-8.1 {icon windows} unix {
list [catch {wm withdraw .icon} msg] $msg
} {1 {can't withdraw .icon: it is an icon for .t}}
test unixWm-8.2 {icon windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 30
list [catch {wm iconwindow} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
test unixWm-8.3 {icon windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 30
list [catch {wm iconwindow .t b c} msg] $msg
} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
test unixWm-8.4 {icon windows} unix {
- catch {destroy .t}
- catch {destroy .icon}
+ destroy .t
+ destroy .icon
toplevel .t -width 100 -height 30
wm geom .t +0+0
set result [wm iconwindow .t]
@@ -292,19 +287,19 @@ test unixWm-8.4 {icon windows} unix {
lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {.icon icon {} withdrawn 1 0 0 0}
test unixWm-8.5 {icon windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 30
list [catch {wm iconwindow .t .gorp} msg] $msg
} {1 {bad window path name ".gorp"}}
test unixWm-8.6 {icon windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 30
frame .t.icon -width 50 -height 50 -bg red
list [catch {wm iconwindow .t .t.icon} msg] $msg
} {1 {can't use .t.icon as icon window: not at top level}}
test unixWm-8.7 {icon windows} unix {
- catch {destroy .t}
- catch {destroy .icon}
+ destroy .t
+ destroy .icon
toplevel .t -width 100 -height 30
wm geom .t +0+0
toplevel .icon -width 50 -height 50 -bg red
@@ -314,10 +309,10 @@ test unixWm-8.7 {icon windows} unix {
wm iconwindow .t .icon2
lappend result [wm iconwindow .t] [wm state .icon] [wm state .icon2]
} {.icon icon normal .icon2 withdrawn icon}
-catch {destroy .icon2}
+destroy .icon2
test unixWm-8.8 {icon windows} unix {
- catch {destroy .t}
- catch {destroy .icon}
+ destroy .t
+ destroy .icon
toplevel .icon -width 50 -height 50 -bg red
wm geom .icon +0+0
update
@@ -333,8 +328,8 @@ test unixWm-8.9 {icon windows} {unix nonPortable} {
# This test is non-portable because some window managers will
# destroy an icon window when it's associated window is destroyed.
- catch {destroy .t}
- catch {destroy .icon}
+ destroy .t
+ destroy .icon
toplevel .t -width 100 -height 30
toplevel .icon -width 50 -height 50 -bg red
wm geom .t +0+0
@@ -376,7 +371,7 @@ test unixWm-8.10.2 {test for memory leaks} unix {
} 1
test unixWm-9.1 {TkWmMapWindow procedure, client property} {unix testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 50
wm geom .t +0+0
wm client .t Test_String
@@ -384,7 +379,7 @@ test unixWm-9.1 {TkWmMapWindow procedure, client property} {unix testwrapper} {
testprop [testwrapper .t] WM_CLIENT_MACHINE
} {Test_String}
test unixWm-9.2 {TkWmMapWindow procedure, command property} {unix testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 50
wm geom .t +0+0
wm command .t "test command"
@@ -394,7 +389,7 @@ test unixWm-9.2 {TkWmMapWindow procedure, command property} {unix testwrapper} {
command
}
test unixWm-9.3 {TkWmMapWindow procedure, iconic windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 300 -bg blue
wm geom .t +0+0
wm iconify .t
@@ -402,7 +397,7 @@ test unixWm-9.3 {TkWmMapWindow procedure, iconic windows} unix {
winfo ismapped .t
} {0}
test unixWm-9.4 {TkWmMapWindow procedure, icon windows} unix {
- catch {destroy .t}
+ destroy .t
sleep 500
toplevel .t -width 100 -height 50 -bg blue
wm iconwindow . .t
@@ -410,17 +405,15 @@ test unixWm-9.4 {TkWmMapWindow procedure, icon windows} unix {
set result [winfo ismapped .t]
} {0}
test unixWm-9.5 {TkWmMapWindow procedure, normal windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 20
wm geom .t +0+0
update
winfo ismapped .t
} {1}
-testConstraint testmenubar [llength [info commands testmenubar]]
-
test unixWm-10.1 {TkWmDeadWindow procedure, canceling UpdateGeometry idle handler} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 50
wm geom .t +0+0
update
@@ -428,8 +421,8 @@ test unixWm-10.1 {TkWmDeadWindow procedure, canceling UpdateGeometry idle handle
destroy .t
} {}
test unixWm-10.2 {TkWmDeadWindow procedure, destroying menubar} {unix testmenubar} {
- catch {destroy .t}
- catch {destroy .f}
+ destroy .t
+ destroy .f
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -452,13 +445,13 @@ test unixWm-11.3 {Tk_WmCmd procedure, miscellaneous errors} unix {
list [catch {wm iconify bogus} msg] $msg
} {1 {bad window path name "bogus"}}
test unixWm-11.4 {Tk_WmCmd procedure, miscellaneous errors} unix {
- catch {destroy .b}
+ destroy .b
button .b -text hello
list [catch {wm geometry .b} msg] $msg
} {1 {window ".b" isn't a top-level window}}
-catch {destroy .t}
-catch {destroy .icon}
+destroy .t
+destroy .icon
toplevel .t -width 100 -height 50
wm geom .t +0+0
@@ -517,7 +510,7 @@ test unixWm-13.2 {Tk_WmCmd procedure, "client" option} {unix testwrapper} {
lappend result [wm client .t] [testprop [testwrapper .t] WM_CLIENT_MACHINE]
} {{} Test_String New {} {}}
test unixWm-13.3 {Tk_WmCmd procedure, "client" option, unmapped window} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm client .t2 Test_String
wm client .t2 {}
@@ -529,7 +522,7 @@ test unixWm-14.1 {Tk_WmCmd procedure, "colormapwindows" option} unix {
list [catch {wm colormapwindows .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm colormapwindows window ?windowList?"}}
test unixWm-14.2 {Tk_WmCmd procedure, "colormapwindows" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 200 -colormap new
wm geom .t2 +0+0
frame .t2.a -width 100 -height 30
@@ -549,7 +542,7 @@ test unixWm-14.4 {Tk_WmCmd procedure, "colormapwindows" option} unix {
list [catch {wm colormapwindows . foo} msg] $msg
} {1 {bad window path name "foo"}}
test unixWm-14.5 {Tk_WmCmd procedure, "colormapwindows" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 200 -colormap new
wm geom .t2 +0+0
frame .t2.a -width 100 -height 30
@@ -560,7 +553,7 @@ test unixWm-14.5 {Tk_WmCmd procedure, "colormapwindows" option} unix {
wm colormapwindows .t2
} {.t2.c .t2 .t2.a}
test unixWm-14.6 {Tk_WmCmd procedure, "colormapwindows" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 200
wm geom .t2 +0+0
frame .t2.a -width 100 -height 30
@@ -571,14 +564,14 @@ test unixWm-14.6 {Tk_WmCmd procedure, "colormapwindows" option} unix {
wm colormapwindows .t2
} {.t2.b .t2.a}
test unixWm-14.7 {Tk_WmCmd procedure, "colormapwindows" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 200 -colormap new
wm geom .t2 +0+0
set x [wm colormapwindows .t2]
wm colormapwindows .t2 {}
list $x [wm colormapwindows .t2]
} {{} {}}
-catch {destroy .t2}
+destroy .t2
test unixWm-15.1 {Tk_WmCmd procedure, "command" option} unix {
list [catch {wm command .t 12 13} msg] $msg
@@ -599,7 +592,7 @@ test unixWm-15.3 {Tk_WmCmd procedure, "command" option} {unix testwrapper} {
command
} {new command} {} {}}
test unixWm-15.4 {Tk_WmCmd procedure, "command" option, window not mapped} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 +0+0
wm command .t2 "test command"
@@ -615,7 +608,7 @@ test unixWm-16.1 {Tk_WmCmd procedure, "deiconify" option} unix {
list [catch {wm deiconify .t 12} msg] $msg
} {1 {wrong # args: should be "wm deiconify window"}}
test unixWm-16.2 {Tk_WmCmd procedure, "deiconify" option} unix {
- catch {destroy .icon}
+ destroy .icon
toplevel .icon -width 50 -height 50 -bg red
wm iconwindow .t .icon
set result [list [catch {wm deiconify .icon} msg] $msg]
@@ -653,7 +646,7 @@ test unixWm-18.2 {Tk_WmCmd procedure, "frame" option} {unix nonPortable} {
expr [wm frame .t] == [winfo id .t]
} {0}
test unixWm-18.3 {Tk_WmCmd procedure, "frame" option} {unix nonPortable} {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 +0+0
wm overrideredirect .t2 1
@@ -677,7 +670,7 @@ test unixWm-19.3 {Tk_WmCmd procedure, "geometry" option} {unix nonPortable} {
wm geometry .t
} {100x50+10-4}
test unixWm-19.4 {Tk_WmCmd procedure, "geometry" option} {unix nonPortable} {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 -5+10
listbox .t2.l -width 30 -height 12 -setgrid 1
@@ -696,7 +689,7 @@ test unixWm-19.5 {Tk_WmCmd procedure, "geometry" option} {unix nonPortable} {
update
lappend result [wm geometry .t]
} {150x300+5+6 100x50+5+6}
-test unixWm-19.6 {Tk_WmCmd procedure, "geometry" option} {unix} {
+test unixWm-19.6 {Tk_WmCmd procedure, "geometry" option} unix {
list [catch {wm geometry .t qrs} msg] $msg
} {1 {bad geometry specifier "qrs"}}
@@ -739,8 +732,8 @@ test unixWm-20.11 {Tk_WmCmd procedure, "grid" option} unix {
list [catch {wm grid .t 10 11 12 -1} msg] $msg
} {1 {heightInc can't be <= 0}}
-catch {destroy .t}
-catch {destroy .icon}
+destroy .t
+destroy .icon
toplevel .t -width 100 -height 50
wm geom .t +0+0
update
@@ -764,7 +757,7 @@ test unixWm-21.3 {Tk_WmCmd procedure, "group" option} {unix testwrapper} {
lappend result [wm group .t] $bit
} {{} . 0x40 {} 0x0}
test unixWm-21.4 {Tk_WmCmd procedure, "group" option, make window exist} {unix testwrapper} {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 +0+0
wm group .t .t2
@@ -774,8 +767,8 @@ test unixWm-21.4 {Tk_WmCmd procedure, "group" option, make window exist} {unix t
set result
} {0}
test unixWm-21.5 {Tk_WmCmd procedure, "group" option, create leader wrapper} {unix testwrapper} {
- catch {destroy .t2}
- catch {destroy .t3}
+ destroy .t2
+ destroy .t3
toplevel .t2 -width 120 -height 300
wm geometry .t2 +0+0
toplevel .t3 -width 120 -height 300
@@ -810,7 +803,7 @@ test unixWm-23.1 {Tk_WmCmd procedure, "iconify" option} unix {
list [catch {wm iconify .t 12} msg] $msg
} {1 {wrong # args: should be "wm iconify window"}}
test unixWm-23.2 {Tk_WmCmd procedure, "iconify" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm overrideredirect .t2 1
set result [list [catch {wm iconify .t2} msg] $msg]
@@ -818,7 +811,7 @@ test unixWm-23.2 {Tk_WmCmd procedure, "iconify" option} unix {
set result
} {1 {can't iconify ".t2": override-redirect flag is set}}
test unixWm-23.3 {Tk_WmCmd procedure, "iconify" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 +0+0
wm transient .t2 .t
@@ -827,7 +820,7 @@ test unixWm-23.3 {Tk_WmCmd procedure, "iconify" option} unix {
set result
} {1 {can't iconify ".t2": it is a transient}}
test unixWm-23.4 {Tk_WmCmd procedure, "iconify" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 +0+0
wm iconwindow .t .t2
@@ -836,7 +829,7 @@ test unixWm-23.4 {Tk_WmCmd procedure, "iconify" option} unix {
set result
} {1 {can't iconify .t2: it is an icon for .t}}
test unixWm-23.5 {Tk_WmCmd procedure, "iconify" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 +0+0
update
@@ -847,7 +840,7 @@ test unixWm-23.5 {Tk_WmCmd procedure, "iconify" option} unix {
set result
} {0}
test unixWm-23.6 {Tk_WmCmd procedure, "iconify" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 -0+0
update
@@ -880,7 +873,7 @@ test unixWm-24.3 {Tk_WmCmd procedure, "iconmask" option} unix {
test unixWm-25.1 {Tk_WmCmd procedure, "iconname" option} unix {
list [catch {wm icon .t} msg] $msg
-} {1 {ambiguous option "icon": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
+} {1 {ambiguous option "icon": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
test unixWm-25.2 {Tk_WmCmd procedure, "iconname" option} unix {
list [catch {wm iconname .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconname window ?newName?"}}
@@ -922,7 +915,7 @@ test unixWm-27.1 {Tk_WmCmd procedure, "iconwindow" option} unix {
list [catch {wm iconwindow .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
test unixWm-27.2 {Tk_WmCmd procedure, "iconwindow" option} {unix testwrapper} {
- catch {destroy .icon}
+ destroy .icon
toplevel .icon -width 50 -height 50 -bg green
set result {}
lappend result [wm iconwindow .t]
@@ -942,16 +935,16 @@ test unixWm-27.3 {Tk_WmCmd procedure, "iconwindow" option} unix {
list [catch {wm iconwindow .t bogus} msg] $msg
} {1 {bad window path name "bogus"}}
test unixWm-27.4 {Tk_WmCmd procedure, "iconwindow" option} unix {
- catch {destroy .b}
+ destroy .b
button .b -text Help
set result [list [catch {wm iconwindow .t .b} msg] $msg]
destroy .b
set result
} {1 {can't use .b as icon window: not at top level}}
test unixWm-27.5 {Tk_WmCmd procedure, "iconwindow" option} unix {
- catch {destroy .icon}
+ destroy .icon
toplevel .icon -width 50 -height 50 -bg green
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
wm geom .t2 -0+0
wm iconwindow .t2 .icon
@@ -961,8 +954,8 @@ test unixWm-27.5 {Tk_WmCmd procedure, "iconwindow" option} unix {
set result
} {1 {.icon is already an icon for .t2}}
test unixWm-27.6 {Tk_WmCmd procedure, "iconwindow" option, changing icons} unix {
- catch {destroy .icon}
- catch {destroy .icon2}
+ destroy .icon
+ destroy .icon2
toplevel .icon -width 50 -height 50 -bg green
toplevel .icon2 -width 50 -height 50 -bg red
set result {}
@@ -974,7 +967,7 @@ test unixWm-27.6 {Tk_WmCmd procedure, "iconwindow" option, changing icons} unix
set result
} {icon normal withdrawn icon}
test unixWm-27.7 {Tk_WmCmd procedure, "iconwindow" option, withdrawing icon} unix {
- catch {destroy .icon}
+ destroy .icon
toplevel .icon -width 50 -height 50 -bg green
wm geometry .icon +0+0
update
@@ -986,38 +979,85 @@ test unixWm-27.7 {Tk_WmCmd procedure, "iconwindow" option, withdrawing icon} uni
set result
} {normal 1 icon 0}
-test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
- wm maxsize .t
-} {1137 870}
+destroy .t
+destroy .icon
+toplevel .t -width 100 -height 50
+wm geom .t +0+0
+update
-test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
- # Not portable, because some window managers let applications override
- # minsize and maxsize.
+test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option, setting the
+ maxsize should update WM_NORMAL_HINTS} {testwrapper} {
+ destroy .t
+ toplevel .t
+ wm maxsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 7] [lindex $hints 8]
+} {300 300}
- wm maxsize .t 200 150
- wm geom .t 300x200
+test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option, setting the
+ maxsize to a value smaller than the current size should
+ set the maxsize in WM_NORMAL_HINTS} {testwrapper} {
+ destroy .t
+ toplevel .t
+ wm geom .t 400x400
+ wm maxsize .t 300 300
update
- list [winfo width .t] [winfo height .t]
-} {200 150}
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 7] [lindex $hints 8]
+} {300 300}
-catch {destroy .t}
-catch {destroy .icon}
-toplevel .t -width 100 -height 50
-wm geom .t +0+0
-update
+test unixWm-28.3 {Tk_WmCmd procedure, "maxsize" option, setting the
+ maxsize to a value smaller than the current size should
+ set the maxsize in WM_NORMAL_HINTS even if the
+ interactive resizable flag is set to 0} {testwrapper} {
+ destroy .t
+ toplevel .t
+ wm geom .t 400x400
+ wm resizable .t 0 0
+ wm maxsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 7] [lindex $hints 8]
+} {300 300}
-test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option} {nonPortable} {
- # Not portable, because some window managers let applications override
- # minsize and maxsize.
+test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option, setting the
+ minsize should update WM_NORMAL_HINTS} {testwrapper} {
+ destroy .t
+ toplevel .t
+ wm minsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 5] [lindex $hints 6]
+} {300 300}
- wm minsize .t 150 100
- wm geom .t 50x50
+test unixWm-29.2 {Tk_WmCmd procedure, "minsize" option, setting the
+ minsize to a value larger than the current size should
+ set the maxsize in WM_NORMAL_HINTS} {testwrapper} {
+ destroy .t
+ toplevel .t
+ wm geom .t 200x200
+ wm minsize .t 300 300
update
- list [winfo width .t] [winfo height .t]
-} {150 100}
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 5] [lindex $hints 6]
+} {300 300}
-catch {destroy .t}
-catch {destroy .icon}
+test unixWm-29.3 {Tk_WmCmd procedure, "minsize" option, setting the
+ minsize to a value larger than the current size should
+ set the minsize in WM_NORMAL_HINTS even if the
+ interactive resizable flag is set to 0} {testwrapper} {
+ destroy .t
+ toplevel .t
+ wm geom .t 200x200
+ wm resizable .t 0 0
+ wm minsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 5] [lindex $hints 6]
+} {300 300}
+
+destroy .t .icon
toplevel .t -width 100 -height 50
wm geom .t +0+0
update
@@ -1125,7 +1165,7 @@ test unixWm-33.5 {Tk_WmCmd procedure, "resizable" option} unix {
list [catch {wm resizable . 0 gorp} msg] $msg
} {1 {expected boolean value but got "gorp"}}
test unixWm-33.6 {Tk_WmCmd procedure, "resizable" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 100
wm geom .t2 +0+0
set result ""
@@ -1169,7 +1209,7 @@ test unixWm-35.2 {Tk_WmCmd procedure, "state" option} unix {
} {1 {wrong # args: should be "wm state window ?state?"}}
test unixWm-35.3 {Tk_WmCmd procedure, "state" option} unix {
set result {}
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 120 -height 300
wm geometry .t2 +0+0
lappend result [wm state .t2]
@@ -1186,7 +1226,7 @@ test unixWm-35.3 {Tk_WmCmd procedure, "state" option} unix {
} {normal normal withdrawn iconic normal}
test unixWm-35.4 {Tk_WmCmd procedure, "state" option} unix {
set result {}
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 120 -height 300
wm geometry .t2 +0+0
lappend result [wm state .t2]
@@ -1216,7 +1256,7 @@ test unixWm-36.2 {Tk_WmCmd procedure, "title" option} {unix testwrapper} {
test unixWm-37.3 {Tk_WmCmd procedure, "transient" option} {unix testwrapper} {
set result {}
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 120 -height 300
wm geometry .t2 +0+0
update
@@ -1232,9 +1272,9 @@ test unixWm-37.3 {Tk_WmCmd procedure, "transient" option} {unix testwrapper} {
set result
} {{} {} .t 0 {} {}}
test unixWm-37.4 {TkWmDeadWindow, destroy on master should clear transient} {unix testwrapper} {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2
- catch {destroy .t3}
+ destroy .t3
toplevel .t3
wm transient .t2 .t3
update
@@ -1243,8 +1283,8 @@ test unixWm-37.4 {TkWmDeadWindow, destroy on master should clear transient} {uni
list [wm transient .t2] [testprop [testwrapper .t2] WM_TRANSIENT_FOR]
} {{} {}}
test unixWm-37.5 {Tk_WmCmd procedure, "transient" option, create master wrapper} {unix testwrapper} {
- catch {destroy .t2}
- catch {destroy .t3}
+ destroy .t2
+ destroy .t3
toplevel .t2 -width 120 -height 300
wm geometry .t2 +0+0
toplevel .t3 -width 120 -height 300
@@ -1260,7 +1300,7 @@ test unixWm-38.1 {Tk_WmCmd procedure, "withdraw" option} unix {
list [catch {wm withdraw .t 1} msg] $msg
} {1 {wrong # args: should be "wm withdraw window"}}
test unixWm-38.2 {Tk_WmCmd procedure, "withdraw" option} unix {
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 120 -height 300
wm geometry .t2 +0+0
wm iconwindow .t .t2
@@ -1278,13 +1318,12 @@ test unixWm-38.3 {Tk_WmCmd procedure, "withdraw" option} unix {
test unixWm-39.1 {Tk_WmCmd procedure, miscellaneous} unix {
list [catch {wm unknown .t} msg] $msg
-} {1 {bad option "unknown": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
+} {1 {bad option "unknown": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
-catch {destroy .t}
-catch {destroy .icon}
+destroy .t .icon
test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on grid} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t
wm geometry .t 30x10+0+0
listbox .t.l -height 20 -width 20 -setgrid 1
@@ -1293,7 +1332,7 @@ test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on gr
wm geometry .t
} {30x10+0+0}
test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already set} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t
wm geometry .t 200x100+0+0
listbox .t.l -height 20 -width 20
@@ -1305,7 +1344,7 @@ test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already
} {20x20+0+0}
test unixWm-41.1 {ConfigureEvent procedure, internally generated size changes} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 400 -height 150
wm geometry .t +0+0
tkwait visibility .t
@@ -1316,7 +1355,7 @@ test unixWm-41.1 {ConfigureEvent procedure, internally generated size changes} u
lappend result [winfo width .t] [winfo height .t]
} {400 150 200 300}
test unixWm-41.2 {ConfigureEvent procedure, menubars} {nonPortable testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -1341,7 +1380,7 @@ test unixWm-41.2 {ConfigureEvent procedure, menubars} {nonPortable testmenubar}
[winfo width .t] [winfo height .t]
} {{.t.m: 200x20} {.t: 200x300} 0 0 200 20 0 20 200 300}
test unixWm-41.3 {ConfigureEvent procedure, synthesized Configure events} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 400 -height 150
wm geometry .t +0+0
tkwait visibility .t
@@ -1352,7 +1391,7 @@ test unixWm-41.3 {ConfigureEvent procedure, synthesized Configure events} unix {
set result
} {configured: 400 150}
test unixWm-41.4 {ConfigureEvent procedure, synthesized Configure events} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 400 -height 150
wm geometry .t +0+0
tkwait visibility .t
@@ -1367,7 +1406,7 @@ test unixWm-41.4 {ConfigureEvent procedure, synthesized Configure events} unix {
# out how to exercise these procedures reliably.
test unixWm-42.1 {WrapperEventProc procedure, map and unmap events} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 400 -height 150
wm geometry .t +0+0
tkwait visibility .t
@@ -1383,7 +1422,7 @@ test unixWm-42.1 {WrapperEventProc procedure, map and unmap events} unix {
} {unmapped 0 mapped 1}
test unixWm-43.1 {TopLevelReqProc procedure, embedded in same process} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200
wm geom .t +0+0
frame .t.f -container 1 -bd 2 -relief raised
@@ -1401,7 +1440,7 @@ test unixWm-43.1 {TopLevelReqProc procedure, embedded in same process} unix {
} {70 120 70 120}
test unixWm-43.2 {TopLevelReqProc procedure, resize causes window to move} \
{unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200
wm geom .t +0+0
update
@@ -1416,7 +1455,7 @@ test unixWm-43.2 {TopLevelReqProc procedure, resize causes window to move} \
} {-100 50 300 150}
test unixWm-44.1 {UpdateGeometryInfo procedure, width/height computation} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 200
wm geometry .t +30+40
wm overrideredirect .t 1
@@ -1426,7 +1465,7 @@ test unixWm-44.1 {UpdateGeometryInfo procedure, width/height computation} unix {
list [winfo width .t] [winfo height .t]
} {180 20}
test unixWm-44.2 {UpdateGeometryInfo procedure, width/height computation} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm grid .t 5 4 10 12
wm geometry .t +30+40
@@ -1437,7 +1476,7 @@ test unixWm-44.2 {UpdateGeometryInfo procedure, width/height computation} unix {
list [winfo width .t] [winfo height .t]
} {130 36}
test unixWm-44.3 {UpdateGeometryInfo procedure, width/height computation} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm grid .t 5 4 10 12
wm geometry .t +30+40
@@ -1448,7 +1487,7 @@ test unixWm-44.3 {UpdateGeometryInfo procedure, width/height computation} unix {
list [winfo width .t] [winfo height .t]
} {40 132}
test unixWm-44.4 {UpdateGeometryInfo procedure, width/height computation} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 200
wm geometry .t +30+40
wm overrideredirect .t 1
@@ -1458,7 +1497,7 @@ test unixWm-44.4 {UpdateGeometryInfo procedure, width/height computation} unix {
list [winfo width .t] [winfo height .t]
} {300 150}
test unixWm-44.5 {UpdateGeometryInfo procedure, negative width} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm grid .t 18 7 10 12
wm geometry .t +30+40
@@ -1469,7 +1508,7 @@ test unixWm-44.5 {UpdateGeometryInfo procedure, negative width} unix {
list [winfo width .t] [winfo height .t]
} {1 72}
test unixWm-44.6 {UpdateGeometryInfo procedure, negative height} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm grid .t 18 7 10 12
wm geometry .t +30+40
@@ -1480,7 +1519,7 @@ test unixWm-44.6 {UpdateGeometryInfo procedure, negative height} unix {
list [winfo width .t] [winfo height .t]
} {100 1}
-catch {destroy .t}
+destroy .t
toplevel .t -width 80 -height 60
test unixWm-44.7 {UpdateGeometryInfo procedure, computing position} unix {
wm geometry .t +5-10
@@ -1489,7 +1528,7 @@ test unixWm-44.7 {UpdateGeometryInfo procedure, computing position} unix {
list [winfo x .t] [winfo y .t]
} [list 5 [expr [winfo screenheight .t] - 70]]
-catch {destroy .t}
+destroy .t
toplevel .t -width 80 -height 60
test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} unix {
wm geometry .t -30+2
@@ -1497,10 +1536,10 @@ test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} unix {
tkwait visibility .t
list [winfo x .t] [winfo y .t]
} [list [expr [winfo screenwidth .t] - 110] 2]
-catch {destroy .t}
+destroy .t
test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unix testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm resizable .t 0 0
wm geometry .t +0+0
@@ -1512,7 +1551,7 @@ test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unix
[expr [lindex $property 7]] [expr [lindex $property 8]]
} {180 20 180 20}
test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} testmenubar {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm resizable .t 0 0
wm geometry .t +0+0
@@ -1527,7 +1566,7 @@ test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} testmenubar {
} {{} {}}
test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unix testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm grid .t 6 10 10 5
wm minsize .t 2 4
@@ -1540,7 +1579,7 @@ test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unix testwrapper
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {40 30 320 210 10 5}
test unixWm-45.2 {UpdateSizeHints procedure} {unix testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
wm minsize .t 30 40
wm maxsize .t 200 500
@@ -1552,7 +1591,7 @@ test unixWm-45.2 {UpdateSizeHints procedure} {unix testwrapper} {
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {30 40 200 500 1 1}
test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} {testmenubar testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
frame .t.menu -height 23 -width 50
testmenubar window .t .t.menu
@@ -1568,7 +1607,7 @@ test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} {testmenubar testwr
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {60 40 53 320 233 10 5}
test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} {testmenubar testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 80 -height 60
frame .t.menu -height 23 -width 50
testmenubar window .t .t.menu
@@ -1585,7 +1624,7 @@ test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} {testmenub
# I don't know how to test WaitForConfigureNotify.
test unixWm-46.1 {WaitForEvent procedure, use of modal timeout} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200
wm geom .t +0+0
update
@@ -1599,7 +1638,7 @@ test unixWm-46.1 {WaitForEvent procedure, use of modal timeout} unix {
} {no yes}
test unixWm-47.1 {WaitRestrictProc procedure} {unix nonPortable} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200
frame .t.f -bd 2 -relief raised
place .t.f -x 20 -y 30 -width 100 -height 20
@@ -1624,7 +1663,7 @@ test unixWm-47.1 {WaitRestrictProc procedure} {unix nonPortable} {
# I don't know how to test WaitTimeoutProc, WaitForMapNotify, or UpdateHints.
-catch {destroy .t}
+destroy .t
toplevel .t -width 300 -height 200
wm geometry .t +0+0
tkwait visibility .t
@@ -1668,7 +1707,7 @@ test unixWm-48.12 {ParseGeometry procedure} unix {
catch {wm geometry .t +30+-10}
} {0}
test unixWm-48.13 {ParseGeometry procedure, resize causes window to move} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200
wm geom .t +0+0
update
@@ -1683,7 +1722,7 @@ test unixWm-48.13 {ParseGeometry procedure, resize causes window to move} unix {
} {50 -100 150 300}
test unixWm-49.1 {Tk_GetRootCoords procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200
frame .t.f -width 150 -height 100 -bd 2 -relief raised
place .t.f -x 150 -y 120
@@ -1695,7 +1734,7 @@ test unixWm-49.1 {Tk_GetRootCoords procedure} unix {
list [winfo rootx .t.f.f] [winfo rooty .t.f.f]
} {202 192}
test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -1785,7 +1824,7 @@ test unixWm-50.3 {
cleanupbg
} -result {{} .x .t .t.f}
test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix {
- catch {destroy .t}
+ destroy .t
catch {interp delete slave}
toplevel .t -width 200 -height 200 -bg green
wm geometry .t +0+0
@@ -1838,7 +1877,7 @@ test unixWm-50.6 {Tk_CoordsToWindow procedure, embedding within one app.} unix {
[winfo containing [expr $x +250] [expr $y +80]]
} {.t .t2 .t2 .t}
test unixWm-50.7 {Tk_CoordsToWindow procedure, more basics} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 400 -bg green
wm geom .t +0+0
frame .t.f -width 100 -height 200 -bd 2 -relief raised
@@ -1855,7 +1894,7 @@ test unixWm-50.7 {Tk_CoordsToWindow procedure, more basics} unix {
[winfo containing $x [expr $y + 450]]
} {.t .t.f .t.f.f .t {}}
test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 400 -height 300 -bg green
wm geom .t +0+0
frame .t.f -width 200 -height 100 -bd 2 -relief raised
@@ -1872,8 +1911,8 @@ test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} unix {
[winfo containing [expr $x + 450] $y]
} {.t .t.f .t.f.f .t {}}
test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} unix {
- catch {destroy .t}
- catch {destroy .t2}
+ destroy .t
+ destroy .t2
sleep 500 ;# Give window manager time to catch up.
toplevel .t -width 200 -height 200 -bg green
wm geometry .t +0+0
@@ -1886,7 +1925,7 @@ test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} unix {
lappend result [winfo containing 100 100]
} {.t2 .t}
test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200 -bg green
wm geometry .t +0+0
frame .t.f -width 150 -height 150 -bd 2 -relief raised
@@ -1956,18 +1995,18 @@ test unixWm-51.5 {TkWmRestackToplevel procedure, basic tests} {unix nonPortable}
} {.raise1 .raise3}
deleteWindows
test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapped} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200 -bg green
wm geometry .t +0+0
tkwait visibility .t
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 200 -bg red
wm geometry .t2 +0+0
winfo containing 100 100
} {.t}
test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} unix {
foreach w {.t .t2 .t3} {
- catch {destroy $w}
+ destroy $w
toplevel $w -width 200 -height 200 -bg green
wm geometry $w +0+0
}
@@ -1980,12 +2019,12 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} unix
lappend result [winfo containing 100 100]
} {.t3 .t}
test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200 -bg green
wm overrideredirect .t 1
wm geometry .t +0+0
tkwait visibility .t
- catch {destroy .t2}
+ destroy .t2
toplevel .t2 -width 200 -height 200 -bg red
wm overrideredirect .t2 1
wm geometry .t2 +0+0
@@ -2006,7 +2045,7 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
} {.t2 .t .t2}
test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} unix {
foreach w {.t .t2 .t3} {
- catch {destroy $w}
+ destroy $w
toplevel $w -width 200 -height 200 -bg green
wm overrideredirect $w 1
wm geometry $w +0+0
@@ -2049,14 +2088,14 @@ test unixWm-51.13 {TkWmRestackToplevel procedure, don't move window that's alrea
} 1
test unixWm-52.1 {TkWmAddToColormapWindows procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 200 -height 200 -colormap new -relief raised -bd 2
wm geom .t +0+0
update
wm colormap .t
} {}
test unixWm-52.2 {TkWmAddToColormapWindows procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -colormap new -relief raised -bd 2
wm geom .t +0+0
frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
@@ -2065,7 +2104,7 @@ test unixWm-52.2 {TkWmAddToColormapWindows procedure} unix {
wm colormap .t
} {.t.f .t}
test unixWm-52.3 {TkWmAddToColormapWindows procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -colormap new
wm geom .t +0+0
frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
@@ -2076,7 +2115,7 @@ test unixWm-52.3 {TkWmAddToColormapWindows procedure} unix {
wm colormap .t
} {.t.f .t.f2 .t}
test unixWm-52.4 {TkWmAddToColormapWindows procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -colormap new
wm geom .t +0+0
frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
@@ -2090,7 +2129,7 @@ test unixWm-52.4 {TkWmAddToColormapWindows procedure} unix {
} {.t.f}
test unixWm-53.1 {TkWmRemoveFromColormapWindows procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -colormap new
wm geom .t +0+0
frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
@@ -2102,7 +2141,7 @@ test unixWm-53.1 {TkWmRemoveFromColormapWindows procedure} unix {
wm colormap .t
} {.t.f .t}
test unixWm-53.2 {TkWmRemoveFromColormapWindows procedure} unix {
- catch {destroy .t}
+ destroy .t
toplevel .t -colormap new
wm geom .t +0+0
frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
@@ -2115,9 +2154,9 @@ test unixWm-53.2 {TkWmRemoveFromColormapWindows procedure} unix {
wm colormap .t
} {}
-test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} unix {
- catch {destroy .t}
- catch {destroy .m}
+test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} {unix nonUnixUserInteraction} {
+ destroy .t
+ destroy .m
toplevel .t -width 300 -height 200 -bd 2 -relief raised
bind .t <Expose> {set x exposed}
wm geom .t +0+0
@@ -2132,8 +2171,8 @@ test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} unix {
destroy .m
set x
} {no event}
-test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} unix {
- catch {destroy .m}
+test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} {unix nonUnixUserInteraction} {
+ destroy .m
menu .m
.m add command -label First
.m add command -label Second
@@ -2148,7 +2187,7 @@ test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} unix {
# No tests for TkGetPointerCoords, CreateWrapper, or GetMaxSize.
test unixWm-55.1 {TkUnixSetMenubar procedure} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -2160,8 +2199,8 @@ test unixWm-55.1 {TkUnixSetMenubar procedure} {unix testmenubar} {
[expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
test unixWm-55.2 {TkUnixSetMenubar procedure, removing menubar} {unix testmenubar} {
- catch {destroy .t}
- catch {destroy .f}
+ destroy .t
+ destroy .f
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -2179,7 +2218,7 @@ test unixWm-55.2 {TkUnixSetMenubar procedure, removing menubar} {unix testmenuba
[expr [winfo rooty .] - [winfo rooty .f]]
} {0 300x30+0+0 0 0 0 0}
test unixWm-55.3 {TkUnixSetMenubar procedure, removing geometry manager} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -2196,7 +2235,7 @@ test unixWm-55.3 {TkUnixSetMenubar procedure, removing geometry manager} {unix t
lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 0 0 0}
test unixWm-55.4 {TkUnixSetMenubar procedure, toplevel not yet created} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
testmenubar window .t .t.f
@@ -2207,8 +2246,8 @@ test unixWm-55.4 {TkUnixSetMenubar procedure, toplevel not yet created} {unix te
[expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
test unixWm-55.5 {TkUnixSetMenubar procedure, changing menubar} {unix testmenubar} {
- catch {destroy .t}
- catch {destroy .f}
+ destroy .t
+ destroy .f
toplevel .t -width 300 -height 200 -bd 2 -relief raised
frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
wm geom .t +0+0
@@ -2226,7 +2265,7 @@ test unixWm-55.5 {TkUnixSetMenubar procedure, changing menubar} {unix testmenuba
lappend result [expr [winfo rooty .f] - $y]
} {0 1 0 1 0 0}
test unixWm-55.6 {TkUnixSetMenubar procedure, changing menubar to self} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
testmenubar window .t .t.f
@@ -2239,8 +2278,8 @@ test unixWm-55.6 {TkUnixSetMenubar procedure, changing menubar to self} {unix te
[expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
test unixWm-55.7 {TkUnixSetMenubar procedure, unsetting event handler} {unix testmenubar} {
- catch {destroy .t}
- catch {destroy .f}
+ destroy .t
+ destroy .f
toplevel .t -width 300 -height 200 -bd 2 -relief raised
frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
frame .f -width 400 -height 40 -bd 2 -relief raised -bg blue
@@ -2259,7 +2298,7 @@ test unixWm-55.7 {TkUnixSetMenubar procedure, unsetting event handler} {unix tes
} {30 40 40}
test unixWm-56.1 {MenubarDestroyProc procedure} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -2274,7 +2313,7 @@ test unixWm-56.1 {MenubarDestroyProc procedure} {unix testmenubar} {
} {30 0}
test unixWm-57.1 {MenubarReqProc procedure} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -2289,7 +2328,7 @@ test unixWm-57.1 {MenubarReqProc procedure} {unix testmenubar} {
lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 10 0 100}
test unixWm-57.2 {MenubarReqProc procedure} {unix testmenubar} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
update
@@ -2305,7 +2344,7 @@ test unixWm-57.2 {MenubarReqProc procedure} {unix testmenubar} {
} {0 20 0 1}
test unixWm-58.1 {UpdateCommand procedure, DString gets reallocated} {unix testwrapper} {
- catch {destroy .t}
+ destroy .t
toplevel .t -width 100 -height 50
wm geom .t +0+0
wm command .t "argumentNumber0 argumentNumber1 argumentNumber2 argumentNumber0 argumentNumber3 argumentNumber4 argumentNumber5 argumentNumber6 argumentNumber0 argumentNumber7 argumentNumber8 argumentNumber9 argumentNumber10 argumentNumber0 argumentNumber11 argumentNumber12 argumentNumber13 argumentNumber14 argumentNumber15 argumentNumber16 argumentNumber17 argumentNumber18"
@@ -2351,14 +2390,16 @@ test unixWm-59.1 {exit processing} unix {
list $error $msg
} {0 {}}
test unixWm-59.2 {exit processing} unix {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
interp create x
x eval {set argc 2}
x eval {set argv "-geometry 10x10+0+0"}
x eval {load {} Tk}
update
exit
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -2368,7 +2409,8 @@ test unixWm-59.2 {exit processing} unix {
list $error $msg
} {0 {}}
test unixWm-59.3 {exit processing} unix {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
interp create x
x eval {set argc 2}
x eval {set argv "-geometry 10x10+0+0"}
@@ -2381,7 +2423,8 @@ test unixWm-59.3 {exit processing} unix {
proc destroy_x {} {interp delete x}
update
exit
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -2391,16 +2434,42 @@ test unixWm-59.3 {exit processing} unix {
list $error $msg
} {0 {}}
-test unixWm-60.1 {wm attributes} unix {
+#
+# wm attributes tests:
+#
+# NOTE: since [wm attributes] is not guaranteed to have any effect,
+# the only thing we can really test here is the syntax.
+#
+test unixWm-60.1 {wm attributes - test} -constraints unix -body {
destroy .t
toplevel .t
wm attributes .t
-} {-type {}}
-test unixWm-60.2 {wm attributes} unix {
+} -result [list -alpha 1.0 -topmost 0 -zoomed 0 -fullscreen 0 -type {}]
+
+test unixWm-60.2 {wm attributes - test} -constraints unix -body {
+ destroy .t
+ toplevel .t
+ wm attributes .t -topmost
+} -result 0
+
+test unixWm-60.3 {wm attributes - set (unrealized)} -constraints unix -body {
destroy .t
toplevel .t
- list [catch {wm attributes .t -foo} msg] $msg
-} {1 {wrong # args: should be "wm attributes window ?-type list?"}}
+ wm attributes .t -topmost 1
+}
+
+test unixWm-60.4 {wm attributes - set (realized)} -constraints unix -body {
+ destroy .t
+ toplevel .t
+ tkwait visibility .t
+ wm attributes .t -topmost 1
+}
+
+test unixWm-60.5 {wm attributes - bad attribute} -constraints unix -body {
+ destroy .t
+ toplevel .t
+ wm attributes .t -foo
+} -returnCodes 1 -match glob -result {bad attribute "-foo":*}
test unixWm-61.1 {Tk_WmCmd procedure, "iconphoto" option} unix {
list [catch {wm iconph .} msg] $msg
@@ -2415,45 +2484,54 @@ test unixWm-61.2 {Tk_WmCmd procedure, "iconphoto" option} unix {
image delete blank16 blank32
} {}
-test unixWm-62.0 {wm attributes -type void} unix {
+test unixWm-62.0 {wm attributes -type void} -constraints unix -setup {
destroy .t
toplevel .t
- set r [list [catch {wm attributes .t -type {}} err] $err]
+} -body {
+ wm attributes .t -type {}
+} -cleanup {
destroy .t
- set r
-} {0 {}}
-test unixWm-62.1 {wm attributes -type name} unix {
+} -result {}
+
+test unixWm-62.1 {wm attributes -type name} -constraints unix -setup {
destroy .t
toplevel .t
- set r [list [catch {wm attributes .t -type dialog} err] $err]
+} -body {
+ wm attributes .t -type dialog
+} -cleanup {
destroy .t
- set r
-} {0 {}}
-test unixWm-62.1 {wm attributes -type name} unix {
+} -result {}
+
+test unixWm-62.2 {wm attributes -type name} -constraints unix -setup {
destroy .t
toplevel .t
+} -body {
tkwait visibility .t
- set r [list [catch {wm attributes .t -type dialog} err] $err]
+ wm attributes .t -type dialog
+} -cleanup {
destroy .t
- set r
-} {0 {}}
-test unixWm-62.2 {wm attributes -type list} unix {
+} -result {}
+
+test unixWm-62.3 {wm attributes -type list} -constraints unix -setup {
destroy .t
toplevel .t
- set r [list [catch {wm attributes .t -type {xyzzy dialog}} err] $err]
+} -body {
+ wm attributes .t -type {xyzzy dialog}
+} -cleanup {
destroy .t
- set r
-} {0 {}}
-test unixWm-62.2 {wm attributes -type list} unix {
+} -result {}
+
+test unixWm-62.4 {wm attributes -type list} -constraints unix -setup {
destroy .t
toplevel .t
+} -body {
tkwait visibility .t
- set r [list [catch {wm attributes .t -type {xyzzy dialog}} err] $err]
+ wm attributes .t -type {xyzzy dialog}
+} -cleanup {
destroy .t
- set r
-} {0 {}}
+} -result {}
# cleanup
-catch {destroy .t}
-::tcltest::cleanupTests
+destroy .t
+cleanupTests
return