summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-10-10 22:22:56 (GMT)
committerhobbs <hobbs>2002-10-10 22:22:56 (GMT)
commitb9e37f089b1bba70eec3e00e70c459fa55355ac6 (patch)
tree1676f618b5a8586139f92af9f24d849dcfefcdd8
parentb060c3480d4c98966503e3f834c2d4e96059ca88 (diff)
downloadtk-b9e37f089b1bba70eec3e00e70c459fa55355ac6.zip
tk-b9e37f089b1bba70eec3e00e70c459fa55355ac6.tar.gz
tk-b9e37f089b1bba70eec3e00e70c459fa55355ac6.tar.bz2
* tests/grid.test:
* generic/tkGrid.c: The grid size was not updated properly when removing a widget from a grid. [Bug #621241] (forssen)
-rw-r--r--ChangeLog4
-rw-r--r--generic/tkGrid.c11
-rw-r--r--tests/grid.test36
3 files changed, 29 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 25717d1..234ea98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2002-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+ * tests/grid.test:
+ * generic/tkGrid.c: The grid size was not updated properly
+ when removing a widget from a grid. [Bug #621241] (forssen)
+
* generic/tkCanvas.h: moved TkColormapData struct to tkCanvPs.c
* generic/tkCanvPs.c (TkImageGetColor): corrected bogus use of
TkColormapData on Windows (Windows now requires RGB pixel data
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index de67a88..4ffbfe5 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkGrid.c,v 1.9.2.1 2002/01/04 16:39:57 dgp Exp $
+ * RCS: @(#) $Id: tkGrid.c,v 1.9.2.2 2002/10/10 22:22:56 hobbs Exp $
*/
#include "tkInt.h"
@@ -1973,18 +1973,15 @@ Unlink(slavePtr)
register Gridder *slavePtr; /* Window to unlink. */
{
register Gridder *masterPtr, *slavePtr2;
- GridMaster *gridPtr; /* pointer to grid data */
masterPtr = slavePtr->masterPtr;
if (masterPtr == NULL) {
return;
}
- gridPtr = masterPtr->masterDataPtr;
if (masterPtr->slavePtr == slavePtr) {
masterPtr->slavePtr = slavePtr->nextPtr;
- }
- else {
+ } else {
for (slavePtr2 = masterPtr->slavePtr; ; slavePtr2 = slavePtr2->nextPtr) {
if (slavePtr2 == NULL) {
panic("Unlink couldn't find previous window");
@@ -2003,9 +2000,7 @@ Unlink(slavePtr)
*masterPtr->abortPtr = 1;
}
- if ((slavePtr->numCols+slavePtr->column == gridPtr->columnMax)
- || (slavePtr->numRows+slavePtr->row == gridPtr->rowMax)) {
- }
+ SetGridSize(slavePtr->masterPtr);
slavePtr->masterPtr = NULL;
}
diff --git a/tests/grid.test b/tests/grid.test
index 31e49df..4c7a171 100644
--- a/tests/grid.test
+++ b/tests/grid.test
@@ -5,7 +5,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: grid.test,v 1.8 2000/04/17 17:44:27 ericm Exp $
+# RCS: @(#) $Id: grid.test,v 1.8.2.1 2002/10/10 22:22:56 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -1240,20 +1240,28 @@ test grid-17.1 {forget and pending idle handlers} {
destroy .t
set result ok
} ok
+grid_reset 17.1
+
+test grid-20.1 {recalculate size after removal (destroy)} {
+ label .l1 -text l1
+ grid .l1 -row 2 -column 2
+ destroy .l1
+ label .l2 -text l2
+ grid .l2
+ grid size .
+} {1 1}
+grid_reset 20.1
+
+test grid-20.2 {recalculate size after removal (forget)} {
+ label .l1 -text l1
+ grid .l1 -row 2 -column 2
+ grid forget .l1
+ label .l2 -text l2
+ grid .l2
+ grid size .
+} {1 1}
+grid_reset 20.2
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-