summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-11-15 00:37:30 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-11-15 00:37:30 (GMT)
commitaf6b3cd3e4c83b73e3c84cfd656bffd05523d141 (patch)
tree94a457439db11c45ad6ecdfc37d41d37f6d56919 /tests
parentd28676b1bedf7d3ce6cd75eae391856fcc1a70d0 (diff)
downloadtk-af6b3cd3e4c83b73e3c84cfd656bffd05523d141.zip
tk-af6b3cd3e4c83b73e3c84cfd656bffd05523d141.tar.gz
tk-af6b3cd3e4c83b73e3c84cfd656bffd05523d141.tar.bz2
[Bug 2239034] Only frame widgets are acceptable for [wm manage]
Diffstat (limited to 'tests')
-rw-r--r--tests/wm.test118
1 files changed, 103 insertions, 15 deletions
diff --git a/tests/wm.test b/tests/wm.test
index 7e2e484..e6905ec 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.39.2.1 2008/08/01 20:24:48 patthoyts Exp $
+# RCS: @(#) $Id: wm.test,v 1.39.2.2 2008/11/15 00:37:30 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: