summaryrefslogtreecommitdiff
path: root/tk/tests/winWm.test
diff options
context:
space:
mode:
Diffstat (limited to 'tk/tests/winWm.test')
-rw-r--r--tk/tests/winWm.test64
1 files changed, 47 insertions, 17 deletions
diff --git a/tk/tests/winWm.test b/tk/tests/winWm.test
index e3d15ea5529..e5d9a8e20fe 100644
--- a/tk/tests/winWm.test
+++ b/tk/tests/winWm.test
@@ -11,13 +11,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- catch {destroy $i}
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Measure the height of a single menu line
@@ -229,18 +228,49 @@ test winWm-5.2 {UpdateGeometryInfo: menu resizing} {pcOnly} {
set result
} {50 50 0}
-# cleanup
-::tcltest::cleanupTests
-return
-
-
-
-
-
-
-
+test winWm-6.1 {wm attributes} {pcOnly} {
+ destroy .t
+ toplevel .t
+ wm attributes .t
+} {-disabled 0 -toolwindow 0 -topmost 0}
+test winWm-6.2 {wm attributes} {pcOnly} {
+ destroy .t
+ toplevel .t
+ wm attributes .t -disabled
+} {0}
+test winWm-6.3 {wm attributes} {pcOnly} {
+ # This isn't quite the correct error message yet, but it works.
+ destroy .t
+ toplevel .t
+ list [catch {wm attributes .t -foo} msg] $msg
+} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+destroy .t
+test winWm-6.1 {deiconify on an unmapped toplevel
+ will raise the window and set the focus} {pcOnly} {
+ destroy .t
+ toplevel .t
+ lower .t
+ focus -force .
+ wm deiconify .t
+ update
+ list [wm stackorder .t isabove .] [focus]
+} {1 .t}
+test winWm-6.2 {deiconify on an already mapped toplevel
+ will raise the window and set the focus} {pcOnly} {
+ destroy .t
+ toplevel .t
+ lower .t
+ update
+ focus -force .
+ wm deiconify .t
+ update
+ list [wm stackorder .t isabove .] [focus]
+} {1 .t}
+# cleanup
+::tcltest::cleanupTests
+return