summaryrefslogtreecommitdiffstats
path: root/tests/pack.test
diff options
context:
space:
mode:
authormdejong <mdejong>2003-03-12 00:09:32 (GMT)
committermdejong <mdejong>2003-03-12 00:09:32 (GMT)
commit6be1cd95fff709a3869038db3e989865154259fb (patch)
treeecef370c50b2d02b66d81ba8deaa5e9601199442 /tests/pack.test
parent7be603f3c85d34e87e54b45c813ecbe337c89854 (diff)
downloadtk-6be1cd95fff709a3869038db3e989865154259fb.zip
tk-6be1cd95fff709a3869038db3e989865154259fb.tar.gz
tk-6be1cd95fff709a3869038db3e989865154259fb.tar.bz2
* generic/tkGrid.c (GridStructureProc, ConfigureSlaves):
Check for a NULL masterPtr and slavePtr in the GridStructureProc code to ensure that a Gridder created before some error condition is ignored when it comes to geometry calculations. This approach closely matches the pack implementation. Keep track of a -in argument to a grid command in order to detect the case of an already gridded widget that wants to change some options. The previous implementation could make repeated and unnecessary calls to Tk_ManageGeometry. Replace use of "parent" with "master" in comments throughout the file. * generic/tkPack.c (PackStructureProc): Check for a NULL masterPtr before other checks so that a slave created under certain error conditions is cleaned up properly. Replace use of "parent" with "master" in comments throughout the file. * generic/tkPlace.c (CreateSlave, ConfigureSlave, SlaveStructureProc): Don't call Tk_ManageGeometry in CreateSlave since this was causing incorrect results in some error cases. Rework the ConfigureSlave method so that slave setup is done in one place. The call to Tk_ManageGeometry was added to the one place where a slave is setup. When a slave is configured but the master is not changed, simply goto the scheduleLayout label. Check for a NULL master in SlaveStructureProc for the sake of readability. * tests/grid.test: * tests/pack.test: * tests/place.test: Add test to check that a winfo manager call does not return incorrect results after an error condition is hit. [Patch 693063]
Diffstat (limited to 'tests/pack.test')
-rw-r--r--tests/pack.test8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/pack.test b/tests/pack.test
index 488281a..c4af29f 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: pack.test,v 1.10 2002/07/13 20:28:35 dgp Exp $
+# RCS: @(#) $Id: pack.test,v 1.11 2003/03/12 00:09:40 mdejong Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -615,6 +615,12 @@ test pack-10.2 {retaining/clearing configuration state} {
pack .pack.a -pady 14
pack info .pack.a
} {-in .pack -anchor n -expand 1 -fill both -ipadx 3 -ipady 4 -padx 1 -pady 14 -side bottom}
+test pack-10.3 {bad -in window does not change master} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [winfo manager .pack.a] \
+ [catch {pack .pack.a -in .pack.a} err] $err \
+ [winfo manager .pack.a]
+} {{} 1 {can't pack .pack.a inside itself} {}}
test pack-11.1 {info option} {
pack4 -in .pack