summaryrefslogtreecommitdiffstats
path: root/tests/wm.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-11-15 00:00:27 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-11-15 00:00:27 (GMT)
commit4c0836f8ae0a1a68edf876a7bcce826b8518d658 (patch)
tree0cd171a59f6750b740f05dea59cfa718220543b3 /tests/wm.test
parent080a0c2bef5e33ed37734a26d0647ea309cc3ea2 (diff)
downloadtk-4c0836f8ae0a1a68edf876a7bcce826b8518d658.zip
tk-4c0836f8ae0a1a68edf876a7bcce826b8518d658.tar.gz
tk-4c0836f8ae0a1a68edf876a7bcce826b8518d658.tar.bz2
bug 2239034: restrict [wm manage] to Frame type widgets
Diffstat (limited to 'tests/wm.test')
-rw-r--r--tests/wm.test118
1 files changed, 103 insertions, 15 deletions
diff --git a/tests/wm.test b/tests/wm.test
index 7a8a538..f28eeab 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.45 2008/10/08 15:39:13 dgp Exp $
+# RCS: @(#) $Id: wm.test,v 1.46 2008/11/15 00:00:27 patthoyts Exp $
# This file tests window manager interactions that work across platforms.
# Window manager tests that only work on a specific platform should be placed
@@ -2091,28 +2091,112 @@ test wm-deletion-epoch-1.1 {Deletion epoch on multiple displays} -constraints al
}
### Docking test (manage, forget) ###
-test wm-manage-1.1 {managing a button} -setup {
+test wm-manage-1.1 {managing a frame} -setup {
set result [list]
} -body {
toplevel .t
- button .t.b -text "Manage This"
- pack .t.b
+ frame .t.f
+ pack [label .t.f.l -text hello]
+ wm manage .t.f
+ raise .t.f
update
- lappend result [winfo manage .t.b]
- lappend result [winfo toplevel .t.b]
- wm manage .t.b
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+} -cleanup {
+ deleteWindows
+} -result {wm .t.f}
+test wm-manage-1.2 {managing a toplevel} -setup {
+ set result [list]
+} -body {
+ toplevel .t
+ pack [label .t.l -text hello]
+ wm manage .t
+ raise .t
update
- lappend result [winfo manage .t.b]
- lappend result [winfo toplevel .t.b]
- wm forget .t.b
- pack .t.b
+ lappend result [winfo manage .t]
+ lappend result [winfo toplevel .t]
+} -cleanup {
+ deleteWindows
+} -result {wm .t}
+test wm-manage-1.3 {managing a labelframe} -setup {
+ set result [list]
+} -body {
+ toplevel .t
+ labelframe .t.f -text Labelframe
+ pack [label .t.f.l -text hello]
+ wm manage .t.f
+ raise .t.f
+ update
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+} -cleanup {
+ deleteWindows
+} -result {wm .t.f}
+test wm-manage-1.4 {managing a ttk::frame} -setup {
+ set result [list]
+} -body {
+ toplevel .t
+ ttk::frame .t.f
+ pack [label .t.f.l -text hello]
+ wm manage .t.f
+ raise .t.f
+ update
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result "window \".t.f\" is not manageable: must be a frame, labelframe or toplevel"
+test wm-manage-1.5 {managing a text widget} -setup {
+ set result [list]
+} -body {
+ toplevel .t
+ text .t.f
+ .t.f insert end "Manage text\n" {}
+ wm manage .t.f
+ raise .t.f
+ update
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result "window \".t.f\" is not manageable: must be a frame, labelframe or toplevel"
+test wm-manage-1.6 {managing a button} -setup {
+ set result [list]
+} -body {
+ toplevel .t
+ button .t.f -text Button
+ wm manage .t.f
+ raise .t.f
+ update
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result "window \".t.f\" is not manageable: must be a frame, labelframe or toplevel"
+test wm-manage-1.7 {managing a frame} -setup {
+ set result [list]
+} -body {
+ toplevel .t
+ frame .t.f
+ pack [label .t.f.l -text Label]
+ pack .t.f
+ update
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+ wm manage .t.f
+ raise .t.f
update
- lappend result [winfo manage .t.b]
- lappend result [winfo toplevel .t.b]
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
+ wm forget .t.f
+ pack .t.f
+ update
+ lappend result [winfo manage .t.f]
+ lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
-} -result {pack .t wm .t.b pack .t}
-test wm-manage-1.2 {unmanaging a toplevel} -setup {
+} -result {pack .t wm .t.f pack .t}
+test wm-manage-1.8 {unmanaging a toplevel} -setup {
set result [list]
} -body {
toplevel .t
@@ -2188,3 +2272,7 @@ cleanupTests
catch {unset results}
catch {unset focusin}
return
+
+# Local variables:
+# mode: tcl
+# End: