summaryrefslogtreecommitdiffstats
path: root/generic/tkPack.c
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2001-09-23 11:30:44 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2001-09-23 11:30:44 (GMT)
commitcda9d85e8ed19fceded9d78a243955ef972b57f8 (patch)
tree53138b4aca7d19804a110115815f1df78525293c /generic/tkPack.c
parent38f3f6ea63f51c5d80a215f5bf71fd23ac5117f2 (diff)
downloadtk-cda9d85e8ed19fceded9d78a243955ef972b57f8.zip
tk-cda9d85e8ed19fceded9d78a243955ef972b57f8.tar.gz
tk-cda9d85e8ed19fceded9d78a243955ef972b57f8.tar.bz2
Pack accepted asymmetric values for -ipadx/y.
Only -padx/y supports asymmetry. [Bug #462348]
Diffstat (limited to 'generic/tkPack.c')
-rw-r--r--generic/tkPack.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/generic/tkPack.c b/generic/tkPack.c
index eeb538a..5ec3496 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkPack.c,v 1.11 2001/09/21 21:34:10 hobbs Exp $
+ * RCS: @(#) $Id: tkPack.c,v 1.12 2001/09/23 11:30:44 pspjuth Exp $
*/
#include "tkPort.h"
@@ -1691,15 +1691,29 @@ ConfigureSlaves(interp, tkwin, objc, objv)
positionGiven = 1;
}
} else if (index == CONF_IPADX) {
- if (TkParsePadAmount(interp, slave, objv[i+1],
- 0, &slavePtr->iPadX) != TCL_OK) {
+ if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ != TCL_OK)
+ || (tmp < 0)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad ipadx value \"",
+ Tcl_GetString(objv[i+1]),
+ "\": must be positive screen distance",
+ (char *) NULL);
return TCL_ERROR;
}
+ slavePtr->iPadX = tmp * 2;
} else if (index == CONF_IPADY) {
- if (TkParsePadAmount(interp, slave, objv[i+1],
- 0, &slavePtr->iPadY) != TCL_OK) {
+ if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ != TCL_OK)
+ || (tmp < 0)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad ipady value \"",
+ Tcl_GetString(objv[i+1]),
+ "\": must be positive screen distance",
+ (char *) NULL);
return TCL_ERROR;
}
+ slavePtr->iPadY = tmp * 2;
} else if (index == CONF_PADX) {
if (TkParsePadAmount(interp, slave, objv[i+1],
&slavePtr->padLeft, &slavePtr->padX) != TCL_OK) {