summaryrefslogtreecommitdiffstats
path: root/generic/tkOldConfig.c
diff options
context:
space:
mode:
authorericm <ericm>2000-05-13 00:39:06 (GMT)
committerericm <ericm>2000-05-13 00:39:06 (GMT)
commitbfa082e9202bf219a84a4bb0d997d6cf1f834516 (patch)
treeb61f779971a9663ee07b65009e60aa206dd22e32 /generic/tkOldConfig.c
parent32c00bd4e54bd4254300852356a6fff59d388d45 (diff)
downloadtk-bfa082e9202bf219a84a4bb0d997d6cf1f834516.zip
tk-bfa082e9202bf219a84a4bb0d997d6cf1f834516.tar.gz
tk-bfa082e9202bf219a84a4bb0d997d6cf1f834516.tar.bz2
* unix/tkUnixButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
* mac/tkMacButton.c (TkpDisplayButton, TkpComputeButtonGeometry): * win/tkWinButton.c (TkpDisplayButton, TkpComputeButtonGeometry): Added code for drawing compound buttons. * tests/button.test: Added configuration tests for -repeatdelay, -repeatinterval, -compound. * library/button.tcl: Added support for -repeatedelay, -repeatinterval options. * generic/tkOldConfig.c: Changed handling of link relief so that proper error messages are used. * generic/tkButton.h: Added -compound, -repeatdelay, -repeatinterval options. * generic/tkButton.c: Added event watchers for enter/leave events, for link relief support. * generic/tk3d.c: Changed handling of link relief so that proper error messages are used. * generic/tk.h: Changed values of TK_OPTION_LINK_OK/TK_CONFIG_LINK_OK for link relief support.
Diffstat (limited to 'generic/tkOldConfig.c')
-rw-r--r--generic/tkOldConfig.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 135e83c..3a373c0 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkOldConfig.c,v 1.7 2000/05/10 00:09:39 ericm Exp $
+ * RCS: @(#) $Id: tkOldConfig.c,v 1.8 2000/05/13 00:39:07 ericm Exp $
*/
#include "tkPort.h"
@@ -483,24 +483,32 @@ DoConfig(interp, tkwin, specPtr, value, valueIsUid, widgRec)
}
case TK_CONFIG_RELIEF:
uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- if (Tk_GetRelief(interp, uid, (int *) ptr) != TCL_OK) {
- return TCL_ERROR;
- }
-
/*
- * Not all widgets allow the link relief. If the given
- * relief is "link" and this widget does not support it,
- * display the "invalid relief" error message and return
- * TCL_ERROR.
+ * In order that error messages be handled properly, we let
+ * GetRelief 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 ((*ptr == TK_RELIEF_LINK) && \
- ((specPtr->specFlags & TK_CONFIG_LINK_OK) == 0)) {
- Tcl_SetResult(interp, "invalid relief \"link\": must be "
- "flat, groove, raised, ridge, solid, or sunken",
- TCL_STATIC);
- return TCL_ERROR;
+
+ if (Tk_GetRelief(interp, uid, (int *) ptr) != TCL_OK) {
+ if ((specPtr->specFlags & TK_CONFIG_LINK_OK) == 0) {
+ return TCL_ERROR;
+ } else {
+ if (uid[0] == 'l' && strcmp(uid, "link") == 0) {
+ *ptr = TK_RELIEF_LINK;
+ Tcl_ResetResult(interp);
+ } else {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad relief \"",
+ uid, "\": must be flat, groove, link, "
+ "raised, ridge, solid, or sunken",
+ (char *)NULL);
+ return TCL_ERROR;
+ }
+ }
}
+
break;
case TK_CONFIG_CURSOR:
case TK_CONFIG_ACTIVE_CURSOR: {