summaryrefslogtreecommitdiffstats
path: root/generic/tkConfig.c
diff options
context:
space:
mode:
authorericm <ericm>2000-08-10 00:21:05 (GMT)
committerericm <ericm>2000-08-10 00:21:05 (GMT)
commitd1c711f1d22a1524af5994cfa3f8888e5bc4dc9e (patch)
tree3acd79b0de2739be7bffae01ae70436c029d98a9 /generic/tkConfig.c
parent33dfdb962c35a1f9a9c1b61e10ab8bd93b1704b6 (diff)
downloadtk-d1c711f1d22a1524af5994cfa3f8888e5bc4dc9e.zip
tk-d1c711f1d22a1524af5994cfa3f8888e5bc4dc9e.tar.gz
tk-d1c711f1d22a1524af5994cfa3f8888e5bc4dc9e.tar.bz2
* doc/SetOptions.3: Updated documentation to reflect support for
TK_OPTION_NULL_OK for TK_OPTION_DOUBLE and TK_OPTION_PIXELS. * generic/tkConfig.c: Added for TK_OPTION_NULL_OK support for TK_OPTION_DOUBLE and TK_OPTION_PIXELS. * doc/place.n: Updated, reformatted manual entry. * tests/place.test: Added many tests. * generic/tkPlace.c (Tk_PlaceObjCmd): Updated to use Tk widget-option management facilities to manage place options (-x, -y, etc.), which simplifies the placer code. Added support for [place configure pathName] and [place configure pathName -option], similar to the behavior of the configure subcommand supported by widgets.
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r--generic/tkConfig.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 0f2bea5..28ebf98 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkConfig.c,v 1.9 2000/05/17 21:17:20 ericm Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.10 2000/08/10 00:21:07 ericm Exp $
*/
/*
@@ -685,10 +685,15 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
case TK_OPTION_DOUBLE: {
double new;
- if (Tcl_GetDoubleFromObj(interp, valuePtr, &new)
- != TCL_OK) {
- return TCL_ERROR;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = 0;
+ } else {
+ if (Tcl_GetDoubleFromObj(interp, valuePtr, &new) != TCL_OK) {
+ return TCL_ERROR;
+ }
}
+
if (internalPtr != NULL) {
*((double *) oldInternalPtr) = *((double *) internalPtr);
*((double *) internalPtr) = new;
@@ -866,10 +871,15 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
case TK_OPTION_PIXELS: {
int new;
-
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
- &new) != TCL_OK) {
- return TCL_ERROR;
+
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = 0;
+ } else {
+ if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
+ &new) != TCL_OK) {
+ return TCL_ERROR;
+ }
}
if (internalPtr != NULL) {
*((int *) oldInternalPtr) = *((int *) internalPtr);