From 7f3008ca65c1e1b6e1b5079bd1eb28794c9e02fb Mon Sep 17 00:00:00 2001 From: pspjuth Date: Sat, 18 Aug 2001 20:03:16 +0000 Subject: Grid configure rejected initial "x" and "^". [Bug #418664] --- ChangeLog | 6 ++++++ doc/grid.n | 15 +++++++++------ generic/tkGrid.c | 5 +++-- tests/grid.test | 18 +++++++++++++++++- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7fd5c6d..2c08b97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-08-18 Peter Spjuth + * doc/grid.n: + * tests/grid.test: + * generic/tkGrid.c: Grid configure rejected initial "x" and "^" + when the doc said it should accept them. [Bug #418664] + 2001-08-17 Donal K. Fellows * generic/tkObj.c (TkGetWindowFromObj): Was failing to reuse diff --git a/doc/grid.n b/doc/grid.n index 809ce50..f5f75d8 100644 --- a/doc/grid.n +++ b/doc/grid.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: grid.n,v 1.3 2001/02/12 18:06:47 drh Exp $ +'\" RCS: @(#) $Id: grid.n,v 1.4 2001/08/18 20:03:16 pspjuth Exp $ '\" .so man.macros .TH grid n 4.1 Tk "Tk Built-In Commands" @@ -25,9 +25,11 @@ The \fBgrid\fR command can have any of several forms, depending on the \fIoption\fR argument: .TP \fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? -If the first argument to \fBgrid\fR is a window name (any value -starting with ``.''), then the command is processed in the same -way as \fBgrid configure\fR. +If the first argument to \fBgrid\fR is suitable as the first slave +argument to \fBgrid configure\fR, either a window name (any value +starting with \fB.\fP) or one of the characters \fBx\fP or \fB^\fP +(see the ``RELATIVE PLACEMENT'' section below), then the command is +processed in the same way as \fBgrid configure\fR. .TP \fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? With no arguments, @@ -249,14 +251,15 @@ default values are chosen for at the time the \fIslave\fP is managed. The values are chosen based upon the current layout of the grid, the position of the \fIslave\fP relative to other \fIslave\fPs in the same grid command, and the presence -of the characters \fB\-\fP, \fB^\fP, and \fB^\fP in \fBgrid\fP +of the characters \fB\-\fP, \fBx\fP, and \fB^\fP in \fBgrid\fP command where \fIslave\fP names are normally expected. .RS .TP \fB\-\fP This increases the columnspan of the \fIslave\fP to the left. Several \fB\-\fP's in a row will successively increase the columnspan. A \fB\-\fP -may not follow a \fB^\fP or a \fBx\fP. +may not follow a \fB^\fP or a \fBx\fP, nor may it be the first \fIslave\fP +argument to \fBgrid configure\fR. .TP \fBx\fP This leaves an empty column between the \fIslave\fP on the left and diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 0d176f5..6685f53 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.11 2001/02/12 18:06:47 drh Exp $ + * RCS: @(#) $Id: tkGrid.c,v 1.12 2001/08/18 20:03:16 pspjuth Exp $ */ #include "tkInt.h" @@ -328,7 +328,8 @@ Tk_GridCmd(clientData, interp, argc, argv) return GridBboxCommand(tkwin, interp, argc, argv); } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) { - if (argv[2][0] != '.') { + if ((argv[2][0] != '.') && (argv[2][0] != REL_SKIP) && + (argv[2][0] != REL_VERT)) { Tcl_AppendResult(interp, "bad argument \"", argv[2], "\": must be name of window", (char *) NULL); return TCL_ERROR; diff --git a/tests/grid.test b/tests/grid.test index 75ead6e..7384748 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.9 2001/02/12 18:06:47 drh Exp $ +# RCS: @(#) $Id: grid.test,v 1.10 2001/08/18 20:03:17 pspjuth Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] @@ -68,6 +68,22 @@ test grid-1.6 {basic argument checking} { list [catch {grid x} msg] $msg } {1 {can't determine master window}} +test grid-1.7 {basic argument checking} { + list [catch {grid configure x} msg] $msg +} {1 {can't determine master window}} + +test grid-1.8 {basic argument checking} { + button .b + list [catch {grid x .b} msg] $msg +} {0 {}} +grid_reset 1.8 + +test grid-1.9 {basic argument checking} { + button .b + list [catch {grid configure x .b} msg] $msg +} {0 {}} +grid_reset 1.9 + test grid-2.1 {bbox} { list [catch {grid bbox .} msg] $msg } {0 {0 0 0 0}} -- cgit v0.12