diff options
author | pspjuth <peter.spjuth@gmail.com> | 2002-07-25 21:35:22 (GMT) |
---|---|---|
committer | pspjuth <peter.spjuth@gmail.com> | 2002-07-25 21:35:22 (GMT) |
commit | 22fb9c3984a951a4a75220e1baddb688801e15ef (patch) | |
tree | 608ffc6660502cadb5242627b23a9954ae489a14 /tests | |
parent | c405da7b48b5b98e265a61df3590913ebc571bdd (diff) | |
download | tk-22fb9c3984a951a4a75220e1baddb688801e15ef.zip tk-22fb9c3984a951a4a75220e1baddb688801e15ef.tar.gz tk-22fb9c3984a951a4a75220e1baddb688801e15ef.tar.bz2 |
Objectifed wm. [Patch #564521]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unixWm.test | 74 | ||||
-rw-r--r-- | tests/winWm.test | 4 | ||||
-rw-r--r-- | tests/wm.test | 954 |
3 files changed, 888 insertions, 144 deletions
diff --git a/tests/unixWm.test b/tests/unixWm.test index 484236d..1841635 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: unixWm.test,v 1.25 2002/07/15 18:10:47 dgp Exp $ +# RCS: @(#) $Id: unixWm.test,v 1.26 2002/07/25 21:35:23 pspjuth Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -275,7 +275,7 @@ test unixWm-8.3 {icon windows} unix { catch {destroy .t} toplevel .t -width 100 -height 30 list [catch {wm iconwindow .t b c} msg] $msg -} {1 {wrong # arguments: must be "wm iconwindow window ?pathName?"}} +} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}} test unixWm-8.4 {icon windows} unix { catch {destroy .t} catch {destroy .icon} @@ -448,10 +448,10 @@ test unixWm-11.1 {Tk_WmCmd procedure, miscellaneous errors} { list [catch {wm} msg] $msg } {1 {wrong # args: should be "wm option window ?arg ...?"}} test unixWm-11.2 {Tk_WmCmd procedure, miscellaneous errors} { - list [catch {wm foo} msg] $msg + list [catch {wm aspect} msg] $msg } {1 {wrong # args: should be "wm option window ?arg ...?"}} test unixWm-11.3 {Tk_WmCmd procedure, miscellaneous errors} { - list [catch {wm foo bogus} msg] $msg + list [catch {wm iconify bogus} msg] $msg } {1 {bad window path name "bogus"}} test unixWm-11.4 {Tk_WmCmd procedure, miscellaneous errors} { catch {destroy .b} @@ -468,10 +468,10 @@ update test unixWm-12.1 {Tk_WmCmd procedure, "aspect" option} { list [catch {wm aspect .t 12} msg] $msg -} {1 {wrong # arguments: must be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} +} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} test unixWm-12.2 {Tk_WmCmd procedure, "aspect" option} { list [catch {wm aspect .t 12 13 14 15 16} msg] $msg -} {1 {wrong # arguments: must be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} +} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} test unixWm-12.3 {Tk_WmCmd procedure, "aspect" option} { set result {} lappend result [wm aspect .t] @@ -507,7 +507,7 @@ test unixWm-12.11 {Tk_WmCmd procedure, "aspect" option} { test unixWm-13.1 {Tk_WmCmd procedure, "client" option} { list [catch {wm client .t x y} msg] $msg -} {1 {wrong # arguments: must be "wm client window ?name?"}} +} {1 {wrong # args: should be "wm client window ?name?"}} test unixWm-13.2 {Tk_WmCmd procedure, "client" option} {unix testwrapper} { set result {} lappend result [wm client .t] @@ -529,7 +529,7 @@ test unixWm-13.3 {Tk_WmCmd procedure, "client" option, unmapped window} { test unixWm-14.1 {Tk_WmCmd procedure, "colormapwindows" option} { list [catch {wm colormapwindows .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm colormapwindows window ?windowList?"}} +} {1 {wrong # args: should be "wm colormapwindows window ?windowList?"}} test unixWm-14.2 {Tk_WmCmd procedure, "colormapwindows" option} { catch {destroy .t2} toplevel .t2 -width 200 -height 200 -colormap new @@ -584,10 +584,10 @@ catch {destroy .t2} test unixWm-15.1 {Tk_WmCmd procedure, "command" option} { list [catch {wm command .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm command window ?value?"}} +} {1 {wrong # args: should be "wm command window ?value?"}} test unixWm-15.2 {Tk_WmCmd procedure, "command" option} { list [catch {wm command .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm command window ?value?"}} +} {1 {wrong # args: should be "wm command window ?value?"}} test unixWm-15.3 {Tk_WmCmd procedure, "command" option} {unix testwrapper} { set result {} lappend result [wm command .t] @@ -615,7 +615,7 @@ test unixWm-15.5 {Tk_WmCmd procedure, "command" option} { test unixWm-16.1 {Tk_WmCmd procedure, "deiconify" option} { list [catch {wm deiconify .t 12} msg] $msg -} {1 {wrong # arguments: must be "wm deiconify window"}} +} {1 {wrong # args: should be "wm deiconify window"}} test unixWm-16.2 {Tk_WmCmd procedure, "deiconify" option} { catch {destroy .icon} toplevel .icon -width 50 -height 50 -bg red @@ -634,7 +634,7 @@ test unixWm-16.3 {Tk_WmCmd procedure, "deiconify" option} { test unixWm-17.1 {Tk_WmCmd procedure, "focusmodel" option} { list [catch {wm focusmodel .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm focusmodel window ?active|passive?"}} +} {1 {wrong # args: should be "wm focusmodel window ?active|passive?"}} test unixWm-17.2 {Tk_WmCmd procedure, "focusmodel" option} { list [catch {wm focusmodel .t bogus} msg] $msg } {1 {bad argument "bogus": must be active or passive}} @@ -650,7 +650,7 @@ test unixWm-17.3 {Tk_WmCmd procedure, "focusmodel" option} { test unixWm-18.1 {Tk_WmCmd procedure, "frame" option} { list [catch {wm frame .t 12} msg] $msg -} {1 {wrong # arguments: must be "wm frame window"}} +} {1 {wrong # args: should be "wm frame window"}} test unixWm-18.2 {Tk_WmCmd procedure, "frame" option} nonPortable { expr [wm frame .t] == [winfo id .t] } {0} @@ -667,7 +667,7 @@ test unixWm-18.3 {Tk_WmCmd procedure, "frame" option} nonPortable { test unixWm-19.1 {Tk_WmCmd procedure, "geometry" option} { list [catch {wm geometry .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm geometry window ?newGeometry?"}} +} {1 {wrong # args: should be "wm geometry window ?newGeometry?"}} test unixWm-19.2 {Tk_WmCmd procedure, "geometry" option} nonPortable { wm geometry .t -1+5 update @@ -704,10 +704,10 @@ test unixWm-19.6 {Tk_WmCmd procedure, "geometry" option} { test unixWm-20.1 {Tk_WmCmd procedure, "grid" option} { list [catch {wm grid .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} +} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} test unixWm-20.2 {Tk_WmCmd procedure, "grid" option} { list [catch {wm grid .t 12 13 14 15 16} msg] $msg -} {1 {wrong # arguments: must be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} +} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} test unixWm-20.3 {Tk_WmCmd procedure, "grid" option} { set result {} lappend result [wm grid .t] @@ -749,7 +749,7 @@ update test unixWm-21.1 {Tk_WmCmd procedure, "group" option} { list [catch {wm group .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm group window ?pathName?"}} +} {1 {wrong # args: should be "wm group window ?pathName?"}} test unixWm-21.2 {Tk_WmCmd procedure, "group" option} { list [catch {wm group .t bogus} msg] $msg } {1 {bad window path name "bogus"}} @@ -791,7 +791,7 @@ test unixWm-21.5 {Tk_WmCmd procedure, "group" option, create leader wrapper} {un test unixWm-22.1 {Tk_WmCmd procedure, "iconbitmap" option} unix { list [catch {wm iconbitmap .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm iconbitmap window ?bitmap?"}} +} {1 {wrong # args: should be "wm iconbitmap window ?bitmap?"}} test unixWm-22.2 {Tk_WmCmd procedure, "iconbitmap" option} {unix testwrapper} { set result {} lappend result [wm iconbitmap .t] @@ -810,7 +810,7 @@ test unixWm-22.3 {Tk_WmCmd procedure, "iconbitmap" option} { test unixWm-23.1 {Tk_WmCmd procedure, "iconify" option} { list [catch {wm iconify .t 12} msg] $msg -} {1 {wrong # arguments: must be "wm iconify window"}} +} {1 {wrong # args: should be "wm iconify window"}} test unixWm-23.2 {Tk_WmCmd procedure, "iconify" option} { catch {destroy .t2} toplevel .t2 @@ -863,7 +863,7 @@ test unixWm-23.6 {Tk_WmCmd procedure, "iconify" option} { test unixWm-24.1 {Tk_WmCmd procedure, "iconmask" option} { list [catch {wm iconmask .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm iconmask window ?bitmap?"}} +} {1 {wrong # args: should be "wm iconmask window ?bitmap?"}} test unixWm-24.2 {Tk_WmCmd procedure, "iconmask" option} {unix testwrapper} { set result {} lappend result [wm iconmask .t] @@ -882,10 +882,10 @@ test unixWm-24.3 {Tk_WmCmd procedure, "iconmask" option} { test unixWm-25.1 {Tk_WmCmd procedure, "iconname" option} { list [catch {wm icon .t} msg] $msg -} {1 {unknown or ambiguous option "icon": must be aspect, attributes, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, 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, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}} test unixWm-25.2 {Tk_WmCmd procedure, "iconname" option} { list [catch {wm iconname .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm iconname window ?newName?"}} +} {1 {wrong # args: should be "wm iconname window ?newName?"}} test unixWm-25.3 {Tk_WmCmd procedure, "iconname" option} {unix testwrapper} { set result {} lappend result [wm iconname .t] @@ -897,10 +897,10 @@ test unixWm-25.3 {Tk_WmCmd procedure, "iconname" option} {unix testwrapper} { test unixWm-26.1 {Tk_WmCmd procedure, "iconposition" option} { list [catch {wm iconposition .t 12} msg] $msg -} {1 {wrong # arguments: must be "wm iconposition window ?x y?"}} +} {1 {wrong # args: should be "wm iconposition window ?x y?"}} test unixWm-26.2 {Tk_WmCmd procedure, "iconposition" option} { list [catch {wm iconposition .t 12 13 14} msg] $msg -} {1 {wrong # arguments: must be "wm iconposition window ?x y?"}} +} {1 {wrong # args: should be "wm iconposition window ?x y?"}} test unixWm-26.3 {Tk_WmCmd procedure, "iconposition" option} {unix testwrapper} { set result {} lappend result [wm iconposition .t] @@ -922,7 +922,7 @@ test unixWm-26.5 {Tk_WmCmd procedure, "iconposition" option} { test unixWm-27.1 {Tk_WmCmd procedure, "iconwindow" option} { list [catch {wm iconwindow .t 12 13} msg] $msg -} {1 {wrong # arguments: must be "wm iconwindow window ?pathName?"}} +} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}} test unixWm-27.2 {Tk_WmCmd procedure, "iconwindow" option} {unix testwrapper} { catch {destroy .icon} toplevel .icon -width 50 -height 50 -bg green @@ -1026,7 +1026,7 @@ update test unixWm-30.1 {Tk_WmCmd procedure, "overrideredirect" option} { list [catch {wm overrideredirect .t 1 2} msg] $msg -} {1 {wrong # arguments: must be "wm overrideredirect window ?boolean?"}} +} {1 {wrong # args: should be "wm overrideredirect window ?boolean?"}} test unixWm-30.2 {Tk_WmCmd procedure, "overrideredirect" option} { list [catch {wm overrideredirect .t boo} msg] $msg } {1 {expected boolean value but got "boo"}} @@ -1041,7 +1041,7 @@ test unixWm-30.3 {Tk_WmCmd procedure, "overrideredirect" option} { test unixWm-31.1 {Tk_WmCmd procedure, "positionfrom" option} { list [catch {wm positionfrom .t 1 2} msg] $msg -} {1 {wrong # arguments: must be "wm positionfrom window ?user/program?"}} +} {1 {wrong # args: should be "wm positionfrom window ?user/program?"}} test unixWm-31.2 {Tk_WmCmd procedure, "positionfrom" option} {unix testwrapper} { set result {} lappend result [wm positionfrom .t] @@ -1062,7 +1062,7 @@ test unixWm-31.3 {Tk_WmCmd procedure, "positionfrom" option} { test unixWm-32.1 {Tk_WmCmd procedure, "protocol" option} { list [catch {wm protocol .t 1 2 3} msg] $msg -} {1 {wrong # arguments: must be "wm protocol window ?name? ?command?"}} +} {1 {wrong # args: should be "wm protocol window ?name? ?command?"}} test unixWm-32.2 {Tk_WmCmd procedure, "protocol" option} { wm protocol .t {foo a} {a b c} wm protocol .t bar {test script for bar} @@ -1113,10 +1113,10 @@ test unixWm-32.5 {Tk_WmCmd procedure, "protocol" option} { test unixWm-33.1 {Tk_WmCmd procedure, "resizable" option} { list [catch {wm resizable . a} msg] $msg -} {1 {wrong # arguments: must be "wm resizable window ?width height?"}} +} {1 {wrong # args: should be "wm resizable window ?width height?"}} test unixWm-33.2 {Tk_WmCmd procedure, "resizable" option} { list [catch {wm resizable . a b c} msg] $msg -} {1 {wrong # arguments: must be "wm resizable window ?width height?"}} +} {1 {wrong # args: should be "wm resizable window ?width height?"}} test unixWm-33.3 {Tk_WmCmd procedure, "resizable" option} { list [catch {wm resizable .foo a b c} msg] $msg } {1 {bad window path name ".foo"}} @@ -1144,7 +1144,7 @@ test unixWm-33.6 {Tk_WmCmd procedure, "resizable" option} { test unixWm-34.1 {Tk_WmCmd procedure, "sizefrom" option} { list [catch {wm sizefrom .t 1 2} msg] $msg -} {1 {wrong # arguments: must be "wm sizefrom window ?user|program?"}} +} {1 {wrong # args: should be "wm sizefrom window ?user|program?"}} test unixWm-34.2 {Tk_WmCmd procedure, "sizefrom" option} {unix testwrapper} { set result {} lappend result [wm sizefrom .t] @@ -1165,10 +1165,10 @@ test unixWm-34.3 {Tk_WmCmd procedure, "sizefrom" option} { test unixWm-35.1 {Tk_WmCmd procedure, "state" option} unix { list [catch {wm state .t 1} msg] $msg -} {1 {bad argument "1": must be normal, iconic or withdrawn}} +} {1 {bad argument "1": must be normal, iconic, or withdrawn}} test unixWm-35.2 {Tk_WmCmd procedure, "state" option} { list [catch {wm state .t iconic 1} msg] $msg -} {1 {wrong # arguments: must be "wm state window ?state?"}} +} {1 {wrong # args: should be "wm state window ?state?"}} test unixWm-35.3 {Tk_WmCmd procedure, "state" option} { set result {} catch {destroy .t2} @@ -1206,7 +1206,7 @@ test unixWm-35.4 {Tk_WmCmd procedure, "state" option} { test unixWm-36.1 {Tk_WmCmd procedure, "title" option} { list [catch {wm title .t 1 2} msg] $msg -} {1 {wrong # arguments: must be "wm title window ?newTitle?"}} +} {1 {wrong # args: should be "wm title window ?newTitle?"}} test unixWm-36.2 {Tk_WmCmd procedure, "title" option} {unix testwrapper} { set result {} lappend result [wm title .t] [testprop [testwrapper .t] WM_NAME] @@ -1260,7 +1260,7 @@ test unixWm-37.5 {Tk_WmCmd procedure, "transient" option, create master wrapper} test unixWm-38.1 {Tk_WmCmd procedure, "withdraw" option} { list [catch {wm withdraw .t 1} msg] $msg -} {1 {wrong # arguments: must be "wm withdraw window"}} +} {1 {wrong # args: should be "wm withdraw window"}} test unixWm-38.2 {Tk_WmCmd procedure, "withdraw" option} { catch {destroy .t2} toplevel .t2 -width 120 -height 300 @@ -1280,7 +1280,7 @@ test unixWm-38.3 {Tk_WmCmd procedure, "withdraw" option} { test unixWm-39.1 {Tk_WmCmd procedure, miscellaneous} { list [catch {wm unknown .t} msg] $msg -} {1 {unknown or ambiguous option "unknown": must be aspect, attributes, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, 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, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}} catch {destroy .t} catch {destroy .icon} @@ -2396,7 +2396,7 @@ test unixWm-60.2 {wm attributes} unix { destroy .t toplevel .t list [catch {wm attributes .t -foo} msg] $msg -} {1 {wrong # arguments: must be "wm attributes window"}} +} {1 {wrong # args: should be "wm attributes window"}} # cleanup catch {destroy .t} diff --git a/tests/winWm.test b/tests/winWm.test index 7f211bf..7bf9810 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -9,7 +9,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: winWm.test,v 1.8 2002/07/13 20:28:36 dgp Exp $ +# RCS: @(#) $Id: winWm.test,v 1.9 2002/07/25 21:35:23 pspjuth Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -243,7 +243,7 @@ test winWm-6.3 {wm attributes} {pcOnly} { destroy .t toplevel .t list [catch {wm attributes .t -foo} msg] $msg -} {1 {wrong # arguments: must be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}} +} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}} destroy .t diff --git a/tests/wm.test b/tests/wm.test index 6d576ea..6d218c1 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: wm.test,v 1.15 2002/07/13 20:28:36 dgp Exp $ +# RCS: @(#) $Id: wm.test,v 1.16 2002/07/25 21:35:23 pspjuth Exp $ # This file tests window manager interactions that work across # platforms. Window manager tests that only work on a specific @@ -25,21 +25,825 @@ if {![winfo ismapped .]} { tkwait visibility . } +proc stdWindow {} { + destroy .t + toplevel .t -width 100 -height 50 + wm geom .t +0+0 + update +} + +deleteWindows +stdWindow + +test wm-1.1 {Tk_WmObjCmd procedure, miscellaneous errors} { + list [catch {wm} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-1.2 {Tk_WmObjCmd procedure, miscellaneous errors} { + list [catch {wm foo} msg] $msg +} {1 {bad option "foo": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}} + +test wm-1.3 {Tk_WmObjCmd procedure, miscellaneous errors} { + list [catch {wm command} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-1.4 {Tk_WmObjCmd procedure, miscellaneous errors} { + list [catch {wm aspect bogus} msg] $msg +} {1 {bad window path name "bogus"}} + +test wm-1.5 {Tk_WmObjCmd procedure, miscellaneous errors} { + catch {destroy .b} + button .b -text hello + list [catch {wm geometry .b} msg] $msg +} {1 {window ".b" isn't a top-level window}} + + +test wm-aspect-1.1 {usage} { + list [catch {wm aspect} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-aspect-1.2 {usage} { + list [catch {wm aspect . _} err] $err +} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} + +test wm-aspect-1.3 {usage} { + list [catch {wm aspect . _ _ _} err] $err +} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} + +test wm-aspect-1.4 {usage} { + list [catch {wm aspect . _ _ _ _ _} err] $err +} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}} + +test wm-aspect-1.5 {usage} { + list [catch {wm aspect . bad 14 15 16} msg] $msg +} {1 {expected integer but got "bad"}} + +test wm-aspect-1.6 {usage} { + list [catch {wm aspect . 13 foo 15 16} msg] $msg +} {1 {expected integer but got "foo"}} + +test wm-aspect-1.7 {usage} { + list [catch {wm aspect . 13 14 bar 16} msg] $msg +} {1 {expected integer but got "bar"}} + +test wm-aspect-1.8 {usage} { + list [catch {wm aspect . 13 14 15 baz} msg] $msg +} {1 {expected integer but got "baz"}} + +test wm-aspect-1.9 {usage} { + list [catch {wm aspect . 0 14 15 16} msg] $msg +} {1 {aspect number can't be <= 0}} + +test wm-aspect-1.10 {usage} { + list [catch {wm aspect . 13 0 15 16} msg] $msg +} {1 {aspect number can't be <= 0}} + +test wm-aspect-1.11 {usage} { + list [catch {wm aspect . 13 14 0 16} msg] $msg +} {1 {aspect number can't be <= 0}} + +test wm-aspect-1.12 {usage} { + list [catch {wm aspect . 13 14 15 0} msg] $msg +} {1 {aspect number can't be <= 0}} + +test wm-aspect-2.1 {setting and reading values} { + set result {} + lappend result [wm aspect .t] + wm aspect .t 3 4 10 2 + lappend result [wm aspect .t] + wm aspect .t {} {} {} {} + lappend result [wm aspect .t] +} [list {} {3 4 10 2} {}] + + +test wm-attributes-1.1 {usage} { + list [catch {wm attributes} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-attributes-1.2.1 {usage} {pcOnly} { + list [catch {wm attributes . _} err] $err +} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}} + +test wm-attributes-1.2.2 {usage} {macOrUnix} { + list [catch {wm attributes . _} err] $err +} {1 {wrong # args: should be "wm attributes window"}} + + +test wm-client-1.1 {usage} { + list [catch {wm client} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-client-1.2 {usage} { + list [catch {wm client . _ _} err] $err +} {1 {wrong # args: should be "wm client window ?name?"}} + +test wm-client-2.1 {setting and reading values} { + set result {} + lappend result [wm client .t] + wm client .t Miffo + lappend result [wm client .t] + wm client .t {} + lappend result [wm client .t] +} [list {} Miffo {}] + + +test wm-colormapwindows-1.1 {usage} { + list [catch {wm colormapwindows} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-colormapwindows-1.2 {usage} { + list [catch {wm colormapwindows . _ _} err] $err +} {1 {wrong # args: should be "wm colormapwindows window ?windowList?"}} + +test wm-colormapwindows-1.3 {usage} { + list [catch {wm colormapwindows . "a \{"} msg] $msg +} {1 {unmatched open brace in list}} + +test wm-colormapwindows-1.4 {usage} { + list [catch {wm colormapwindows . foo} msg] $msg +} {1 {bad window path name "foo"}} + +test wm-colormapwindows-2.1 {reading values} { + catch {destroy .t2} + toplevel .t2 -width 200 -height 200 -colormap new + wm geom .t2 +0+0 + frame .t2.a -width 100 -height 30 + frame .t2.b -width 100 -height 30 -colormap new + pack .t2.a .t2.b -side top + update + set x [wm colormapwindows .t2] + frame .t2.c -width 100 -height 30 -colormap new + pack .t2.c -side top + update + list $x [wm colormapwindows .t2] +} {{.t2.b .t2} {.t2.b .t2.c .t2}} + +test wm-colormapwindows-2.2 {setting and reading values} { + catch {destroy .t2} + toplevel .t2 -width 200 -height 200 + wm geom .t2 +0+0 + frame .t2.a -width 100 -height 30 + frame .t2.b -width 100 -height 30 + frame .t2.c -width 100 -height 30 + pack .t2.a .t2.b .t2.c -side top + wm colormapwindows .t2 {.t2.b .t2.a} + wm colormapwindows .t2 +} {.t2.b .t2.a} + + +test wm-command-1.1 {usage} { + list [catch {wm command} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-command-1.2 {usage} { + list [catch {wm command . _ _} err] $err +} {1 {wrong # args: should be "wm command window ?value?"}} + +test wm-command-1.3 {usage} { + list [catch {wm command . "a \{"} msg] $msg +} {1 {unmatched open brace in list}} + +test wm-command-2.1 {setting and reading values} { + set result {} + lappend result [wm command .t] + wm command .t [list Miffo Foo] + lappend result [wm command .t] + wm command .t {} + lappend result [wm command .t] +} [list {} [list Miffo Foo] {}] + + +test wm-deiconify-1.1 {usage} { + list [catch {wm deiconify} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-deiconify-1.2 {usage} { + list [catch {wm deiconify . _} err] $err +} {1 {wrong # args: should be "wm deiconify window"}} + +test wm-deiconify-1.3 {usage} { + list [catch {wm deiconify _} err] $err +} {1 {bad window path name "_"}} + +test wm-deiconify-1.4 {usage} { + catch {destroy .icon} + toplevel .icon -width 50 -height 50 -bg red + wm iconwindow .t .icon + set result [list [catch {wm deiconify .icon} msg] $msg] + destroy .icon + set result +} {1 {can't deiconify .icon: it is an icon for .t}} + +test wm-deiconify-1.5 {usage} { + catch {destroy .embed} + frame .t.f -container 1 + toplevel .embed -use [winfo id .t.f] + set result [list [catch {wm deiconify .embed} msg] $msg] + destroy .t.f .embed + set result +} {1 {can't deiconify .embed: it is an embedded window}} + +test wm-deiconify-2.1 {a window that has never been mapped + should not be mapped by a call to deiconify} { + deleteWindows + toplevel .t + wm deiconify .t + winfo ismapped .t +} 0 + +test wm-deiconify-2.2 {a window that has already been + mapped should be mapped by deiconify} { + deleteWindows + toplevel .t + update idletasks + wm withdraw .t + wm deiconify .t + winfo ismapped .t +} 1 + +test wm-deiconify-2.3 {geometry for an unmapped window + should not be calculated by a call to deiconify, + it should be done at idle time} { + deleteWindows + set results {} + toplevel .t -width 200 -height 200 + lappend results [wm geometry .t] + wm deiconify .t + lappend results [wm geometry .t] + update idletasks + lappend results [lindex [split \ + [wm geometry .t] +] 0] +} {1x1+0+0 1x1+0+0 200x200} + +test wm-deiconify-2.4 {invoking destroy after a deiconify + should not result in a crash because of a callback + set on the toplevel} { + deleteWindows + toplevel .t + wm withdraw .t + wm deiconify .t + destroy .t + update +} {} + + +test wm-focusmodel-1.1 {usage} { + list [catch {wm focusmodel} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-focusmodel-1.2 {usage} { + list [catch {wm focusmodel . _ _} err] $err +} {1 {wrong # args: should be "wm focusmodel window ?active|passive?"}} + +test wm-focusmodel-1.3 {usage} { + list [catch {wm focusmodel . bogus} msg] $msg +} {1 {bad argument "bogus": must be active or passive}} + +stdWindow + +test wm-focusmodel-2.1 {setting and reading values} { + set result {} + lappend result [wm focusmodel .t] + wm focusmodel .t active + lappend result [wm focusmodel .t] + wm focusmodel .t passive + lappend result [wm focusmodel .t] + set result +} {passive active passive} + + +test wm-frame-1.1 {usage} { + list [catch {wm frame} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-frame-1.2 {usage} { + list [catch {wm frame . _} err] $err +} {1 {wrong # args: should be "wm frame window"}} + + +test wm-geometry-1.1 {usage} { + list [catch {wm geometry} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-geometry-1.2 {usage} { + list [catch {wm geometry . _ _} err] $err +} {1 {wrong # args: should be "wm geometry window ?newGeometry?"}} + +test wm-geometry-1.3 {usage} { + list [catch {wm geometry . bogus} msg] $msg +} {1 {bad geometry specifier "bogus"}} + +test wm-geometry-2.1 {setting values} { + set result {} + wm geometry .t 150x150+50+50 + update + lappend result [wm geometry .t] + wm geometry .t {} + update + lappend result [string equal [wm geometry .t] "150x150+50+50"] +} [list 150x150+50+50 0] + + +test wm-grid-1.1 {usage} { + list [catch {wm grid} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-grid-1.2 {usage} { + list [catch {wm grid . _} err] $err +} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} + +test wm-grid-1.3 {usage} { + list [catch {wm grid . _ _ _} err] $err +} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} + +test wm-grid-1.4 {usage} { + list [catch {wm grid . _ _ _ _ _} err] $err +} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}} + +test wm-grid-1.5 {usage} { + list [catch {wm grid . bad 14 15 16} msg] $msg +} {1 {expected integer but got "bad"}} + +test wm-grid-1.6 {usage} { + list [catch {wm grid . 13 foo 15 16} msg] $msg +} {1 {expected integer but got "foo"}} + +test wm-grid-1.7 {usage} { + list [catch {wm grid . 13 14 bar 16} msg] $msg +} {1 {expected integer but got "bar"}} + +test wm-grid-1.8 {usage} { + list [catch {wm grid . 13 14 15 baz} msg] $msg +} {1 {expected integer but got "baz"}} + +test wm-grid-1.9 {usage} { + list [catch {wm grid . -1 14 15 16} msg] $msg +} {1 {baseWidth can't be < 0}} + +test wm-grid-1.10 {usage} { + list [catch {wm grid . 13 -1 15 16} msg] $msg +} {1 {baseHeight can't be < 0}} + +test wm-grid-1.11 {usage} { + list [catch {wm grid . 13 14 -1 16} msg] $msg +} {1 {widthInc can't be < 0}} + +test wm-grid-1.12 {usage} { + list [catch {wm grid . 13 14 15 -1} msg] $msg +} {1 {heightInc can't be < 0}} + +test wm-grid-2.1 {setting and reading values} { + set result {} + lappend result [wm grid .t] + wm grid .t 3 4 10 2 + lappend result [wm grid .t] + wm grid .t {} {} {} {} + lappend result [wm grid .t] +} [list {} {3 4 10 2} {}] + + +test wm-group-1.1 {usage} { + list [catch {wm group} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-group-1.2 {usage} { + list [catch {wm group .t 12 13} msg] $msg +} {1 {wrong # args: should be "wm group window ?pathName?"}} + +test wm-group-1.3 {usage} { + list [catch {wm group .t bogus} msg] $msg +} {1 {bad window path name "bogus"}} + +test wm-group-2.1 {setting and reading values} { + set result {} + lappend result [wm group .t] + wm group .t . + lappend result [wm group .t] + wm group .t {} + lappend result [wm group .t] +} [list {} . {}] + + +test wm-iconbitmap-1.1 {usage} { + list [catch {wm iconbitmap} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-iconbitmap-1.2.1 {usage} {macOrUnix} { + list [catch {wm iconbitmap .t 12 13} msg] $msg +} {1 {wrong # args: should be "wm iconbitmap window ?bitmap?"}} + +test wm-iconbitmap-1.2.2 {usage} {pcOnly} { + list [catch {wm iconbitmap .t 12 13 14} msg] $msg +} {1 {wrong # args: should be "wm iconbitmap window ?-default? ?image?"}} + +test wm-iconbitmap-1.3 {usage} {pcOnly} { + list [catch {wm iconbitmap .t 12 13} msg] $msg +} {1 {illegal option "12" must be "-default"}} + +test wm-iconbitmap-1.4 {usage} { + list [catch {wm iconbitmap .t bad-bitmap} msg] $msg +} {1 {bitmap "bad-bitmap" not defined}} + +test wm-iconbitmap-2.1 {setting and reading values} { + set result {} + lappend result [wm iconbitmap .t] + wm iconbitmap .t hourglass + lappend result [wm iconbitmap .t] + wm iconbitmap .t {} + lappend result [wm iconbitmap .t] +} [list {} hourglass {}] + + +test wm-iconify-1.1 {usage} { + list [catch {wm iconify} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-iconify-1.2 {usage} { + list [catch {wm iconify .t _} msg] $msg +} {1 {wrong # args: should be "wm iconify window"}} + +test wm-iconify-2.1 {Misc errors} { + catch {destroy .t2} + toplevel .t2 + wm overrideredirect .t2 1 + set result [list [catch {wm iconify .t2} msg] $msg] + destroy .t2 + set result +} {1 {can't iconify ".t2": override-redirect flag is set}} + +test wm-iconify-2.2 {Misc errors} { + catch {destroy .t2} + toplevel .t2 + wm geom .t2 +0+0 + wm transient .t2 .t + set result [list [catch {wm iconify .t2} msg] $msg] + destroy .t2 + set result +} {1 {can't iconify ".t2": it is a transient}} + +test wm-iconify-2.3 {Misc errors} { + catch {destroy .t2} + toplevel .t2 + wm geom .t2 +0+0 + wm iconwindow .t .t2 + set result [list [catch {wm iconify .t2} msg] $msg] + destroy .t2 + set result +} {1 {can't iconify .t2: it is an icon for .t}} + +test wm-iconify-2.4 {Misc errors} { + catch {destroy .t2} + frame .t.f -container 1 + toplevel .t2 -use [winfo id .t.f] + set result [list [catch {wm iconify .t2} msg] $msg] + destroy .t2 .r.f + set result +} {1 {can't iconify .t2: it is an embedded window}} + +test wm-iconify-3.1 {} { + catch {destroy .t2} + toplevel .t2 + wm geom .t2 -0+0 + update + set result [winfo ismapped .t2] + wm iconify .t2 + update + lappend result [winfo ismapped .t2] + destroy .t2 + set result +} {1 0} + + +test wm-iconmask-1.1 {usage} { + list [catch {wm iconmask} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-iconmask-1.2 {usage} { + list [catch {wm iconmask .t 12 13} msg] $msg +} {1 {wrong # args: should be "wm iconmask window ?bitmap?"}} + +test wm-iconmask-1.3 {usage} { + list [catch {wm iconmask .t bad-bitmap} msg] $msg +} {1 {bitmap "bad-bitmap" not defined}} + +test wm-iconmask-2.1 {setting and reading values} { + set result {} + lappend result [wm iconmask .t] + wm iconmask .t hourglass + lappend result [wm iconmask .t] + wm iconmask .t {} + lappend result [wm iconmask .t] +} [list {} hourglass {}] + + +test wm-iconname-1.1 {usage} { + list [catch {wm iconname} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-iconname-1.2 {usage} { + list [catch {wm iconname .t 12 13} msg] $msg +} {1 {wrong # args: should be "wm iconname window ?newName?"}} + +test wm-iconname-2.1 {setting and reading values} { + set result {} + lappend result [wm iconname .t] + wm iconname .t ThisIconHasAName + lappend result [wm iconname .t] + wm iconname .t {} + lappend result [wm iconname .t] +} [list {} ThisIconHasAName {}] + + +test wm-iconposition-1.1 {usage} { + list [catch {wm iconposition} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-iconposition-1.2 {usage} { + list [catch {wm iconposition .t 12} msg] $msg +} {1 {wrong # args: should be "wm iconposition window ?x y?"}} + +test wm-iconposition-1.3 {usage} { + list [catch {wm iconposition .t 12 13 14} msg] $msg +} {1 {wrong # args: should be "wm iconposition window ?x y?"}} + +test wm-iconposition-1.4 {usage} { + list [catch {wm iconposition .t bad 13} msg] $msg +} {1 {expected integer but got "bad"}} + +test wm-iconposition-1.5 {usage} { + list [catch {wm iconposition .t 13 lousy} msg] $msg +} {1 {expected integer but got "lousy"}} + +test wm-iconposition-2.1 {setting and reading values} { + set result {} + lappend result [wm iconposition .t] + wm iconposition .t 10 20 + lappend result [wm iconposition .t] + wm iconposition .t {} {} + lappend result [wm iconposition .t] +} [list {} {10 20} {}] + + +test wm-iconwindow-1.1 {usage} { + list [catch {wm iconwindow} err] $err +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-iconwindow-1.2 {usage} { + list [catch {wm iconwindow .t 12 13} msg] $msg +} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}} + +test wm-iconwindow-1.3 {usage} { + list [catch {wm iconwindow .t bogus} msg] $msg +} {1 {bad window path name "bogus"}} + +test wm-iconwindow-1.4 {usage} { + catch {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 wm-iconwindow-1.5 {usage} { + catch {destroy .icon} + toplevel .icon -width 50 -height 50 -bg green + catch {destroy .t2} + toplevel .t2 + wm geom .t2 -0+0 + wm iconwindow .t2 .icon + set result [list [catch {wm iconwindow .t .icon} msg] $msg] + destroy .t2 + destroy .icon + set result +} {1 {.icon is already an icon for .t2}} + +test wm-iconwindow-2.1 {setting and reading values} { + set result {} + lappend result [wm iconwindow .t] + catch {destroy .icon} + toplevel .icon -width 50 -height 50 -bg green + wm iconwindow .t .icon + lappend result [wm iconwindow .t] + wm iconwindow .t {} + destroy .icon + lappend result [wm iconwindow .t] +} [list {} .icon {}] + + +test wm-maxsize-1.1 {usage} { + list [catch {wm maxsize} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-maxsize-1.2 {usage} { + list [catch {wm maxsize . a} msg] $msg +} {1 {wrong # args: should be "wm maxsize window ?width height?"}} + +test wm-maxsize-1.3 {usage} { + list [catch {wm maxsize . a b c} msg] $msg +} {1 {wrong # args: should be "wm maxsize window ?width height?"}} + +test wm-maxsize-1.4 {usage} { + list [catch {wm maxsize . x 100} msg] $msg +} {1 {expected integer but got "x"}} + +test wm-maxsize-1.5 {usage} { + list [catch {wm maxsize . 100 bogus} msg] $msg +} {1 {expected integer but got "bogus"}} + +test wm-maxsize-1.6 {usage} { + catch {destroy .t2} + toplevel .t2 + wm maxsize .t2 200 150 + set result [wm maxsize .t2] + destroy .t2 + set result +} {200 150} + + +test wm-minsize-1.1 {usage} { + list [catch {wm minsize} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-minsize-1.2 {usage} { + list [catch {wm minsize . a} msg] $msg +} {1 {wrong # args: should be "wm minsize window ?width height?"}} + +test wm-minsize-1.3 {usage} { + list [catch {wm minsize . a b c} msg] $msg +} {1 {wrong # args: should be "wm minsize window ?width height?"}} + +test wm-minsize-1.4 {usage} { + list [catch {wm minsize . x 100} msg] $msg +} {1 {expected integer but got "x"}} + +test wm-minsize-1.5 {usage} { + list [catch {wm minsize . 100 bogus} msg] $msg +} {1 {expected integer but got "bogus"}} + +test wm-minsize-1.6 {usage} { + catch {destroy .t2} + toplevel .t2 + wm minsize .t2 200 150 + set result [wm minsize .t2] + destroy .t2 + set result +} {200 150} + + +test wm-overrideredirect-1.1 {usage} { + list [catch {wm overrideredirect} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-overrideredirect-1.2 {usage} { + list [catch {wm overrideredirect .t 1 2} msg] $msg +} {1 {wrong # args: should be "wm overrideredirect window ?boolean?"}} + +test wm-overrideredirect-1.3 {usage} { + list [catch {wm overrideredirect .t boo} msg] $msg +} {1 {expected boolean value but got "boo"}} + +test wm-overrideredirect-2.1 {setting and reading values} { + set result {} + lappend result [wm overrideredirect .t] + wm overrideredirect .t true + lappend result [wm overrideredirect .t] + wm overrideredirect .t off + lappend result [wm overrideredirect .t] +} {0 1 0} + + +test wm-positionfrom-1.1 {usage} { + list [catch {wm positionfrom} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-positionfrom-1.2 {usage} { + list [catch {wm positionfrom .t 1 2} msg] $msg +} {1 {wrong # args: should be "wm positionfrom window ?user/program?"}} + +test wm-positionfrom-1.3 {usage} { + list [catch {wm positionfrom .t none} msg] $msg +} {1 {bad argument "none": must be program or user}} + +test wm-positionfrom-2.1 {setting and reading values} { + catch {destroy .t2} + toplevel .t2 + set result {} + wm positionfrom .t user + lappend result [wm positionfrom .t] + wm positionfrom .t program + lappend result [wm positionfrom .t] + wm positionfrom .t {} + lappend result [wm positionfrom .t] + destroy .t2 + set result +} {user program {}} + + +test wm-protocol-1.1 {usage} { + list [catch {wm protocol} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-protocol-1.2 {usage} { + list [catch {wm protocol .t 1 2 3} msg] $msg +} {1 {wrong # args: should be "wm protocol window ?name? ?command?"}} + +test wm-protocol-2.1 {setting and reading values} { + wm protocol .t {foo a} {a b c} + wm protocol .t bar {test script for bar} + set result [wm protocol .t] + wm protocol .t {foo a} {} + wm protocol .t bar {} + set result +} {bar {foo a}} + +test wm-protocol-2.2 {setting and reading values} { + set result {} + wm protocol .t foo {a b c} + wm protocol .t bar {test script for bar} + lappend result [wm protocol .t foo] [wm protocol .t bar] + wm protocol .t foo {} + wm protocol .t bar {} + lappend result [wm protocol .t foo] [wm protocol .t bar] +} {{a b c} {test script for bar} {} {}} + +test wm-protocol-2.3 {setting and reading values} { + wm protocol .t foo {a b c} + wm protocol .t foo {test script} + set result [wm protocol .t foo] + wm protocol .t foo {} + set result +} {test script} + + +test wm-resizable-1.1 {usage} { + list [catch {wm resizable} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-resizable-1.2 {usage} { + list [catch {wm resizable .t 1} msg] $msg +} {1 {wrong # args: should be "wm resizable window ?width height?"}} + +test wm-resizable-1.3 {usage} { + list [catch {wm resizable .t 1 2 3} msg] $msg +} {1 {wrong # args: should be "wm resizable window ?width height?"}} + +test wm-resizable-1.4 {usage} { + list [catch {wm resizable .t bad 0} msg] $msg +} {1 {expected boolean value but got "bad"}} + +test wm-resizable-1.5 {usage} { + list [catch {wm resizable .t 1 bad} msg] $msg +} {1 {expected boolean value but got "bad"}} + +test wm-resizable-2.1 {setting and reading values} { + wm resizable .t 0 1 + set result [wm resizable .t] + wm resizable .t 1 0 + lappend result [wm resizable .t] + wm resizable .t 1 1 + lappend result [wm resizable .t] +} {0 1 {1 0} {1 1}} + + +test wm-sizefrom-1.1 {usage} { + list [catch {wm sizefrom} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-sizefrom-1.2 {usage} { + list [catch {wm sizefrom .t 1 2} msg] $msg +} {1 {wrong # args: should be "wm sizefrom window ?user|program?"}} + +test wm-sizefrom-1.4 {usage} { + list [catch {wm sizefrom .t bad} msg] $msg +} {1 {bad argument "bad": must be program or user}} + +test wm-sizefrom-2.1 {setting and reading values} { + set result [list [wm sizefrom .t]] + wm sizefrom .t user + lappend result [wm sizefrom .t] + wm sizefrom .t program + lappend result [wm sizefrom .t] + wm sizefrom .t {} + lappend result [wm sizefrom .t] +} {{} user program {}} + + + test wm-stackorder-1.1 {usage} { list [catch {wm stackorder} err] $err } {1 {wrong # args: should be "wm option window ?arg ...?"}} test wm-stackorder-1.2 {usage} { list [catch {wm stackorder . _} err] $err -} {1 {wrong # arguments: must be "wm stackorder window ?isabove|isbelow window?"}} +} {1 {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}} test wm-stackorder-1.3 {usage} { list [catch {wm stackorder . _ _ _} err] $err -} {1 {wrong # arguments: must be "wm stackorder window ?isabove|isbelow window?"}} +} {1 {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}} test wm-stackorder-1.4 {usage} { list [catch {wm stackorder . is .} err] $err -} {1 {bad argument "is": must be isabove or isbelow}} +} {1 {ambiguous argument "is": must be isabove or isbelow}} test wm-stackorder-1.5 {usage} { list [catch {wm stackorder _} err] $err @@ -299,11 +1103,31 @@ test wm-stackorder-6.1 {An embedded toplevel does not wm stackorder . } {. .real} +stdWindow + +test wm-title-1.1 {usage} { + list [catch {wm title} msg] $msg +} {1 {wrong # args: should be "wm option window ?arg ...?"}} + +test wm-title-1.2 {usage} { + list [catch {wm title . 1 2} msg] $msg +} {1 {wrong # args: should be "wm title window ?newTitle?"}} + +test wm-title-2.1 {setting and reading values} { + destroy .t + toplevel .t + set result [wm title .t] + wm title .t Apa + lappend result [wm title .t] + wm title .t {} + lappend result [wm title .t] +} {t Apa {}} + test wm-transient-1.1 {usage} { catch {destroy .t} ; toplevel .t list [catch {wm transient .t 1 2} msg] $msg -} {1 {wrong # arguments: must be "wm transient window ?master?"}} +} {1 {wrong # args: should be "wm transient window ?master?"}} test wm-transient-1.2 {usage} { catch {destroy .t} ; toplevel .t @@ -552,7 +1376,7 @@ test wm-state-1.1 {usage} { test wm-state-1.2 {usage} { list [catch {wm state . _ _} err] $err -} {1 {wrong # arguments: must be "wm state window ?state?"}} +} {1 {wrong # args: should be "wm state window ?state?"}} test wm-state-2.1 {initial state} { deleteWindows @@ -689,112 +1513,32 @@ test wm-state-2.17 {state change after map} { } {normal} -test wm-maxsize-1.1 {usage} { - list [catch {wm maxsize} msg] $msg -} {1 {wrong # args: should be "wm option window ?arg ...?"}} - -test wm-maxsize-1.2 {usage} { - list [catch {wm maxsize . a} msg] $msg -} {1 {wrong # arguments: must be "wm maxsize window ?width height?"}} - -test wm-maxsize-1.3 {usage} { - list [catch {wm maxsize . a b c} msg] $msg -} {1 {wrong # arguments: must be "wm maxsize window ?width height?"}} - -test wm-maxsize-1.4 {usage} { - list [catch {wm maxsize . x 100} msg] $msg -} {1 {expected integer but got "x"}} - -test wm-maxsize-1.5 {usage} { - list [catch {wm maxsize . 100 bogus} msg] $msg -} {1 {expected integer but got "bogus"}} - -test wm-maxsize-1.6 {usage} { - wm maxsize .t 200 150 - wm maxsize .t -} {200 150} - - -test wm-minsize-1.1 {usage} { - list [catch {wm minsize} msg] $msg -} {1 {wrong # args: should be "wm option window ?arg ...?"}} - -test wm-minsize-1.2 {usage} { - list [catch {wm minsize . a} msg] $msg -} {1 {wrong # arguments: must be "wm minsize window ?width height?"}} - -test wm-minsize-1.3 {usage} { - list [catch {wm minsize . a b c} msg] $msg -} {1 {wrong # arguments: must be "wm minsize window ?width height?"}} - -test wm-minsize-1.4 {usage} { - list [catch {wm minsize . x 100} msg] $msg -} {1 {expected integer but got "x"}} - -test wm-minsize-1.5 {usage} { - list [catch {wm minsize . 100 bogus} msg] $msg -} {1 {expected integer but got "bogus"}} - -test wm-minsize-1.6 {usage} { - wm minsize .t 200 150 - wm minsize .t -} {200 150} - - -test wm-deiconify-1.1 {usage} { - list [catch {wm deiconify} err] $err +test wm-withdraw-1.1 {usage} { + list [catch {wm withdraw} err] $err } {1 {wrong # args: should be "wm option window ?arg ...?"}} -test wm-deiconify-1.2 {usage} { - list [catch {wm deiconify . _} err] $err -} {1 {wrong # arguments: must be "wm deiconify window"}} - -test wm-deiconify-1.3 {usage} { - list [catch {wm deiconify _} err] $err -} {1 {bad window path name "_"}} - -test wm-deiconify-2.1 {a window that has never been mapped - should not be mapped by a call to deiconify} { - deleteWindows - toplevel .t - wm deiconify .t - winfo ismapped .t -} 0 - -test wm-deiconify-2.2 {a window that has already been - mapped should be mapped by deiconify} { - deleteWindows - toplevel .t - update idletasks - wm withdraw .t - wm deiconify .t - winfo ismapped .t -} 1 +test wm-withdraw-1.2 {usage} { + list [catch {wm withdraw . _} msg] $msg +} {1 {wrong # args: should be "wm withdraw window"}} -test wm-deiconify-2.3 {geometry for an unmapped window - should not be calculated by a call to deiconify, - it should be done at idle time} { - deleteWindows - set results {} - toplevel .t -width 200 -height 200 - lappend results [wm geometry .t] - wm deiconify .t - lappend results [wm geometry .t] - update idletasks - lappend results [lindex [split \ - [wm geometry .t] +] 0] -} {1x1+0+0 1x1+0+0 200x200} - -test wm-deiconify-2.4 {invoking destroy after a deiconify - should not result in a crash because of a callback - set on the toplevel} { +test wm-withdraw-2.1 {Misc errors} { deleteWindows toplevel .t + toplevel .t2 + wm iconwindow .t .t2 + set result [list [catch {wm withdraw .t2} msg] $msg] + destroy .t2 + set result +} {1 {can't withdraw .t2: it is an icon for .t}} + +test wm-withdraw-3.1 {} { + update + set result {} wm withdraw .t + lappend result [wm state .t] [winfo ismapped .t] wm deiconify .t - destroy .t - update -} {} + lappend result [wm state .t] [winfo ismapped .t] +} {withdrawn 0 normal 1} # FIXME: |