1 # This file is a Tcl script to test the procedures in the file
2 # tkCmds.c. It is organized in the standard fashion for Tcl tests.
4 # Copyright (c) 1996 Sun Microsystems, Inc.
5 # Copyright (c) 1998-1999 by Scriptics Corporation.
8 package require tcltest 2.2
9 eval tcltest::configure $argv
10 tcltest::loadTestedCommands
11 namespace import -force tcltest::test
15 test cmds-1.1 {tkwait visibility, argument errors} -body {
17 } -returnCodes {error} -result {wrong # args: should be "tkwait variable|visibility|window name"}
18 test cmds-1.2 {tkwait visibility, argument errors} -body {
19 tkwait visibility foo bar
20 } -returnCodes {error} -result {wrong # args: should be "tkwait variable|visibility|window name"}
21 test cmds-1.3 {tkwait visibility, argument errors} -body {
22 tkwait visibility bad_window
23 } -returnCodes {error} -result {bad window path name "bad_window"}
24 test cmds-1.4 {tkwait visibility, waiting for window to be mapped} -setup {
25 button .b -text "Test"
28 after 100 {set x delay; place .b -x 0 -y 0}
34 test cmds-1.5 {tkwait visibility, window gets deleted} -setup {
36 button .f.b -text "Test"
40 after 100 {set x deleted; destroy .f}
41 tkwait visibility .f.b
42 } -returnCodes {error} -result {window ".f.b" was deleted before its visibility changed}
43 test cmds-1.6 {tkwait visibility, window gets deleted} -setup {
45 button .f.b -text "Test"
49 after 100 {set x deleted; destroy .f}
50 catch {tkwait visibility .f.b}