summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericm <ericm>2000-10-01 21:31:35 (GMT)
committerericm <ericm>2000-10-01 21:31:35 (GMT)
commit5c06a2b6a522b05e7d208c8eb130ceed025357b5 (patch)
treeac6a7a75130d27feefe8fce4d0333c5f8d692013
parent550ed6e220a4b17dd1059ff841b5f416b73f4195 (diff)
downloadtk-5c06a2b6a522b05e7d208c8eb130ceed025357b5.zip
tk-5c06a2b6a522b05e7d208c8eb130ceed025357b5.tar.gz
tk-5c06a2b6a522b05e7d208c8eb130ceed025357b5.tar.bz2
* doc/SetOptions.3: Added note that restoreProc and freeProc may
be NULL. * generic/tkConfig.c (Tk_RestoreSavedOptions): For custom options, added test that the restoreProc is not NULL, to allow for custom options that don't care about supporting Tk_RestoreSavedOptions.
-rw-r--r--ChangeLog9
-rw-r--r--doc/SetOptions.36
-rw-r--r--generic/tkConfig.c10
3 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d4b33ef..761dcfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-10-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/SetOptions.3: Added note that restoreProc and freeProc may
+ be NULL.
+
+ * generic/tkConfig.c (Tk_RestoreSavedOptions): For custom options,
+ added test that the restoreProc is not NULL, to allow for custom
+ options that don't care about supporting Tk_RestoreSavedOptions.
+
2000-09-29 Jeff Hobbs <hobbs@scriptics.com>
* win/Makefile.in: commented use of TESTFLAGS
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3
index 7bb8e51..7abc944 100644
--- a/doc/SetOptions.3
+++ b/doc/SetOptions.3
@@ -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: SetOptions.3,v 1.7 2000/09/29 17:55:30 ericm Exp $
+'\" RCS: @(#) $Id: SetOptions.3,v 1.8 2000/10/01 21:31:35 ericm Exp $
'\"
.so man.macros
.TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures"
@@ -555,7 +555,9 @@ for the custom option type; pointers to the four procedures; and a
\fIclientData\fR value to be passed to those procedures when they are
invoked. The \fIclientData\fR value typically points to a structure
containing information that is needed by the procedures when they are
-parsing and printing options.
+parsing and printing options. \fIRestoreProc\fR and \fIfreeProc\fR
+may be NULL, indicating that no function should be called for those
+operations.
.PP
The \fIsetProc\fR procedure is invoked by \fBTk_SetOptions\fR to
convert a Tcl_Obj into an internal representation and store the
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index ad64aaf..dfdd237 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.12 2000/09/29 17:55:31 ericm Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.13 2000/10/01 21:31:36 ericm Exp $
*/
/*
@@ -1432,9 +1432,11 @@ Tk_RestoreSavedOptions(savePtr)
}
case TK_OPTION_CUSTOM: {
Tk_ObjCustomOption *custom = optionPtr->extra.custom;
- custom->restoreProc(custom->clientData, savePtr->tkwin,
- internalPtr,
- (char *)&savePtr->items[i].internalForm);
+ if (custom->restoreProc != NULL) {
+ custom->restoreProc(custom->clientData, savePtr->tkwin,
+ internalPtr,
+ (char *)&savePtr->items[i].internalForm);
+ }
break;
}
default: {