summaryrefslogtreecommitdiffstats
path: root/generic/tkConfig.c
diff options
context:
space:
mode:
authorericm <ericm>2000-05-17 21:17:19 (GMT)
committerericm <ericm>2000-05-17 21:17:19 (GMT)
commit54e6352675121c47a41ffafce8b02911986cac96 (patch)
treecc806cc6c8cbd3daf45e4f418ada919e3ab812e0 /generic/tkConfig.c
parent2adfe2dab62fa99750852c0a35ff3dbedb810adc (diff)
downloadtk-54e6352675121c47a41ffafce8b02911986cac96.zip
tk-54e6352675121c47a41ffafce8b02911986cac96.tar.gz
tk-54e6352675121c47a41ffafce8b02911986cac96.tar.bz2
* doc/SetOptions.3: Added information about TK_OPTION_NULL_OK with
TK_OPTION_RELIEF. * win/tkWinButton.c: Removed bits about TK_RELIEF_LINK. * tests/button.test: Added tests for -overrelief; removed tests for -relief link. * mac/tkMacButton.c: Removed bits about TK_RELIEF_LINK. * generic/tkOldConfig.c: Removed bits about TK_RELIEF_LINK. * generic/tkConfig.c: Removed bits about TK_RELIEF_LINK; added support for TK_OPTION_NULL_OK for TK_OPTION_RELIEF. * library/button.tcl: Added binding support for -overrelief. * generic/tk3d.c (Tk_GetRelief): Added branch for TK_RELIEF_NULL. * generic/tkButton.c: Added -overrelief option; removed Enter/Leave EventProc masks and handlers. * generic/tk.h: Added TK_RELIEF_NULL definition, removed TK_RELIEF_LINK. * mac/tkMacDefault.h (DEF_BUTTON_OVER_RELIEF): * win/tkWinDefault.h (DEF_BUTTON_OVER_RELIEF): * unix/tkUnixDefault.h (DEF_BUTTON_OVER_RELIEF): Added default value for the -overrelief option.
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r--generic/tkConfig.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 5739a7e..0f2bea5 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.8 2000/05/10 00:09:39 ericm Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.9 2000/05/17 21:17:20 ericm Exp $
*/
/*
@@ -804,34 +804,15 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
case TK_OPTION_RELIEF: {
int new;
- char *valueStr;
-
- if (Tk_GetReliefFromObj(interp, valuePtr, &new) != TCL_OK) {
- /*
- * In order that error messages be handled properly, we let
- * GetReliefFromObj do the first pass check on the relief
- * string. If it fails there, and the option spec doesn't
- * allow for LINK relief, return an error. If the option spec
- * does allow LINK relief, see if the string matches "link".
- */
- if ((specPtr->flags & TK_OPTION_LINK_OK) == 0) {
+
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = TK_RELIEF_NULL;
+ } else {
+ if (Tk_GetReliefFromObj(interp, valuePtr, &new) != TCL_OK) {
return TCL_ERROR;
- } else {
- valueStr = Tcl_GetString(valuePtr);
- if (valueStr[0] == 'l' && strcmp(valueStr, "link") == 0) {
- new = TK_RELIEF_LINK;
- Tcl_ResetResult(interp);
- } else {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad relief \"",
- valueStr, "\": must be flat, groove, link, "
- "raised, ridge, solid, or sunken",
- (char *)NULL);
- return TCL_ERROR;
- }
}
}
-
if (internalPtr != NULL) {
*((int *) oldInternalPtr) = *((int *) internalPtr);
*((int *) internalPtr) = new;