summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index ff50130..ff45455 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMenu.c,v 1.13 2001/10/12 13:30:31 tmh Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.14 2002/01/17 05:13:11 dgp Exp $
*/
/*
@@ -105,8 +105,10 @@ TCL_DECLARE_MUTEX(menuMutex)
char *tkMenuStateStrings[] = {"active", "normal", "disabled", (char *) NULL};
-static char *menuEntryTypeStrings[] = {"cascade", "checkbutton", "command",
- "radiobutton", "separator", (char *) NULL};
+static CONST char *menuEntryTypeStrings[] = {
+ "cascade", "checkbutton", "command", "radiobutton", "separator",
+ (char *) NULL
+};
/*
* The following table defines the legal values for the -compound option.
@@ -243,7 +245,7 @@ static Tk_OptionSpec *specsArray[] = {
* Menu type strings for use with Tcl_GetIndexFromObj.
*/
-static char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
+static CONST char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
(char *) NULL};
Tk_OptionSpec tkMenuConfigSpecs[] = {
@@ -311,7 +313,7 @@ Tk_OptionSpec tkMenuConfigSpecs[] = {
* along with MenuWidgetObjCmd.
*/
-static char *menuOptions[] = {
+static CONST char *menuOptions[] = {
"activate", "add", "cget", "clone", "configure", "delete", "entrycget",
"entryconfigure", "index", "insert", "invoke", "post", "postcascade",
"type", "unpost", "yposition", (char *) NULL
@@ -463,7 +465,7 @@ MenuCmd(clientData, interp, objc, objv)
int i, index;
int toplevel;
char *windowName;
- static char *typeStringList[] = {"-type", (char *) NULL};
+ static CONST char *typeStringList[] = {"-type", (char *) NULL};
TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData;
if (objc < 2) {
@@ -1012,9 +1014,9 @@ MenuWidgetObjCmd(clientData, interp, objc, objv)
if (menuPtr->entries[index]->type == TEAROFF_ENTRY) {
Tcl_SetResult(interp, "tearoff", TCL_STATIC);
} else {
- Tcl_SetResult(interp,
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
menuEntryTypeStrings[menuPtr->entries[index]->type],
- TCL_STATIC);
+ -1);
}
break;
}