summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorlfb <lfb>1999-02-13 05:38:48 (GMT)
committerlfb <lfb>1999-02-13 05:38:48 (GMT)
commitbb3a7b29672682e6ed7dfd992a6356232826ae00 (patch)
tree2612ada346984444f2d11d4776c2dfe00266da4e /generic
parent87ac90f01b224ffd9fe8ea63c5677ce380bece3a (diff)
downloadtk-bb3a7b29672682e6ed7dfd992a6356232826ae00.zip
tk-bb3a7b29672682e6ed7dfd992a6356232826ae00.tar.gz
tk-bb3a7b29672682e6ed7dfd992a6356232826ae00.tar.bz2
Removed Tk_Uids from Menubutton widget.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkMenubutton.c24
-rw-r--r--generic/tkMenubutton.h4
2 files changed, 16 insertions, 12 deletions
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index f4960fa..dfef406 100644
--- a/generic/tkMenubutton.c
+++ b/generic/tkMenubutton.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMenubutton.c,v 1.1.4.4 1999/01/07 02:42:50 lfb Exp $
+ * RCS: @(#) $Id: tkMenubutton.c,v 1.1.4.5 1999/02/13 05:38:48 lfb Exp $
*/
#include "tkMenubutton.h"
@@ -109,7 +109,7 @@ static Tk_ConfigSpec configSpecs[] = {
DEF_MENUBUTTON_PADY, Tk_Offset(TkMenuButton, padY), 0},
{TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
DEF_MENUBUTTON_RELIEF, Tk_Offset(TkMenuButton, relief), 0},
- {TK_CONFIG_STATE, "-state", "state", "State",
+ {TK_CONFIG_STRING, "-state", "state", "State",
DEF_MENUBUTTON_STATE, Tk_Offset(TkMenuButton, state), 0},
{TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_MENUBUTTON_TAKE_FOCUS, Tk_Offset(TkMenuButton, takeFocus),
@@ -216,7 +216,7 @@ Tk_MenubuttonCmd(clientData, interp, argc, argv)
mbPtr->bitmap = None;
mbPtr->imageString = NULL;
mbPtr->image = NULL;
- mbPtr->state = TK_STATE_NORMAL;
+ mbPtr->state = "normal";
mbPtr->normalBorder = NULL;
mbPtr->activeBorder = NULL;
mbPtr->borderWidth = 0;
@@ -260,7 +260,7 @@ Tk_MenubuttonCmd(clientData, interp, argc, argv)
rightUid = Tk_GetUid("right");
flushUid = Tk_GetUid("flush");
}
- Tcl_MutexLock(&menuButMutex);
+ Tcl_MutexUnlock(&menuButMutex);
}
mbPtr->direction = flushUid;
@@ -458,16 +458,20 @@ ConfigureMenuButton(interp, mbPtr, argc, argv, flags)
* defaults that couldn't be specified to Tk_ConfigureWidget.
*/
- if ((mbPtr->state == TK_STATE_ACTIVE) && !Tk_StrictMotif(mbPtr->tkwin)) {
+ if ((mbPtr->state[0] == 'a') && (strcmp(mbPtr->state, "active") == 0)
+ && !Tk_StrictMotif(mbPtr->tkwin)) {
Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->activeBorder);
} else {
Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->normalBorder);
- if ((mbPtr->state != TK_STATE_NORMAL)
- && (mbPtr->state != TK_STATE_ACTIVE)
- && (mbPtr->state != TK_STATE_DISABLED)) {
+ if ((mbPtr->state[0] != 'a')
+ && (strcmp(mbPtr->state, "active") != 0)
+ && (mbPtr->state[0] != 'd')
+ && (strcmp(mbPtr->state, "disabled") != 0)
+ && (mbPtr->state[0] != 'n')
+ && (strcmp(mbPtr->state, "normal") != 0)) {
Tcl_AppendResult(interp, "bad state value \"", mbPtr->state,
- "\": must be normal, active, or disabled", (char *) NULL);
- mbPtr->state = TK_STATE_NORMAL;
+ "\": must be normal, active, or disabled", (char *) NULL);
+ mbPtr->state = "normal";
return TCL_ERROR;
}
}
diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h
index e9481ab..f934b51 100644
--- a/generic/tkMenubutton.h
+++ b/generic/tkMenubutton.h
@@ -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: tkMenubutton.h,v 1.1.4.2 1999/01/07 02:42:50 lfb Exp $
+ * RCS: @(#) $Id: tkMenubutton.h,v 1.1.4.3 1999/02/13 05:38:49 lfb Exp $
*/
#ifndef _TKMENUBUTTON
@@ -65,7 +65,7 @@ typedef struct {
* Information used when displaying widget:
*/
- int state; /* State of button for display purposes:
+ char * state; /* State of button for display purposes:
* normal, active, or disabled. */
Tk_3DBorder normalBorder; /* Structure used to draw 3-D
* border and background when window