summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorericm <ericm>2000-01-20 23:46:20 (GMT)
committerericm <ericm>2000-01-20 23:46:20 (GMT)
commit08776342a8dd10c3f9f3cbba8655a1e4abbafafc (patch)
treea64375903efa812908da558697622cf750421827 /generic
parent028293934889d9f696d2315b98e902adb757bd68 (diff)
downloadtk-08776342a8dd10c3f9f3cbba8655a1e4abbafafc.zip
tk-08776342a8dd10c3f9f3cbba8655a1e4abbafafc.tar.gz
tk-08776342a8dd10c3f9f3cbba8655a1e4abbafafc.tar.bz2
* tests/grid.test: Added a test for the consecutive ^ and multiple
widget case (bug #1386). * generic/tkGrid.c: Fixed interpretation of consecutive ^ characters in grid command. Previously, ^ ^ was interpreted as meaning that there must be a 2-column widget above to extend, neglecting the case where there was actually 2 1-column widgets above. Now, ^ ^ is interpreted as a possible width; the gridder will consume as many ^'s as there are columns in the widget, and leave the rest for the extension of other widgets. (bug #1386).
Diffstat (limited to 'generic')
-rw-r--r--generic/tkGrid.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index fbc8306..5b4f9b8 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.6 1999/11/10 02:56:25 hobbs Exp $
+ * RCS: @(#) $Id: tkGrid.c,v 1.7 2000/01/20 23:46:20 ericm Exp $
*/
#include "tkInt.h"
@@ -2505,6 +2505,7 @@ ConfigureSlaves(interp, tkwin, argc, argv)
return TCL_ERROR;
}
+ /* Count the number of consecutive ^'s starting from this position */
for (width=1; width+j < numWindows && *argv[j+width] == REL_VERT;
width++) {
/* Null Body */
@@ -2517,7 +2518,7 @@ ConfigureSlaves(interp, tkwin, argc, argv)
if (lastWindow == NULL) {
if (masterPtr->masterDataPtr != NULL) {
SetGridSize(masterPtr);
- lastRow = masterPtr->masterDataPtr->rowEnd - 1;
+ lastRow = masterPtr->masterDataPtr->rowEnd - 2;
} else {
lastRow = 0;
}
@@ -2525,27 +2526,30 @@ ConfigureSlaves(interp, tkwin, argc, argv)
} else {
other = Tk_NameToWindow(interp, lastWindow, tkwin);
otherPtr = GetGrid(other);
- lastRow = otherPtr->row;
+ lastRow = otherPtr->row + otherPtr->numRows - 2;
lastColumn = otherPtr->column + otherPtr->numCols;
}
for (match=0, slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = slavePtr->nextPtr) {
- if (slavePtr->numCols == width
- && slavePtr->column == lastColumn
- && slavePtr->row + slavePtr->numRows == lastRow) {
- slavePtr->numRows++;
- match++;
+ if (slavePtr->column == lastColumn
+ && slavePtr->row + slavePtr->numRows - 1 == lastRow) {
+ if (slavePtr->numCols <= width) {
+ slavePtr->numRows++;
+ match++;
+ j += slavePtr->numCols - 1;
+ lastWindow = Tk_PathName(slavePtr->tkwin);
+ break;
+ }
}
- lastWindow = Tk_PathName(slavePtr->tkwin);
}
if (!match) {
Tcl_AppendResult(interp, "can't find slave to extend with \"^\".",
(char *) NULL);
return TCL_ERROR;
}
- j += width - 1;
+/* j += width - 1; */
}
if (masterPtr == NULL) {