summaryrefslogtreecommitdiffstats
path: root/generic/tkConfig.c
diff options
context:
space:
mode:
authorericm <ericm>2000-05-10 00:09:38 (GMT)
committerericm <ericm>2000-05-10 00:09:38 (GMT)
commit7ff73db610e3d2efd82c272471c0dfe16d5745b8 (patch)
tree36475aa7b20157ca2cd0fba5339eb61b1484aead /generic/tkConfig.c
parent5766ce10779959eb0437e49fc4bdb3045982a63d (diff)
downloadtk-7ff73db610e3d2efd82c272471c0dfe16d5745b8.zip
tk-7ff73db610e3d2efd82c272471c0dfe16d5745b8.tar.gz
tk-7ff73db610e3d2efd82c272471c0dfe16d5745b8.tar.bz2
* doc/button.n: Added documentation for link relief.
* tests/button.test: Added tests for link relief for buttons. * generic/tk.h (TK_CONFIG_LINK_OK): Added definition of TK_RELIEF_LINK, TK_OPTION_LINK_OK and TK_CONFIG_LINK_OK. [RFE: 4348] * generic/tk3d.c: Added support for link relief. [RFE: 4348] * mac/tkMacButton.c (TkpDisplayButton): * unix/tkUnixButton.c (TkpDisplayButton): Added support for link relief. [RFE: 4348] * generic/tkOldConfig.c (Tk_ConfigureWidget): * generic/tkConfig.c (DoObjConfig): Added understanding of link relief, which is allowed only for widgets that have TK_OPTION_LINK_OK or TK_CONFIG_LINK_OK set for the "-relief" option. [RFE: 4348] * generic/tkButton.c: Added TK_OPTION_LINK_OK to "-relief" option for buttons. [RFE: 4348] * win/tkWinWm.c (EX_TRANSIENT_STYLE): Removed WS_EX_TOOLWINDOW style bit, so that transient windows have full-size titlebars (like the tk_getOpenFile dialog). * win/tkWinMenu.c (GetMenuSeparatorGeometry): Tweaked height requested for separator bars to be (linespace - (2*descent)) instead of just (linespace); this makes the separator occupy a more correct amount of vertical space. [Bug: 5303].
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r--generic/tkConfig.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 471af9d..5739a7e 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.7 2000/04/25 01:02:30 hobbs Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.8 2000/05/10 00:09:39 ericm Exp $
*/
/*
@@ -804,10 +804,34 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
case TK_OPTION_RELIEF: {
int new;
-
+ char *valueStr;
+
if (Tk_GetReliefFromObj(interp, valuePtr, &new) != TCL_OK) {
- return TCL_ERROR;
+ /*
+ * 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) {
+ 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;