summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorericm <ericm>2000-08-03 20:36:15 (GMT)
committerericm <ericm>2000-08-03 20:36:15 (GMT)
commit0cdb0677540aa8995226f52ec82b9037920b6d29 (patch)
treeff2867076396bc073331bbed420d5ef47e09b88e /generic/tkMenu.c
parent7d67184a277c2923bc3f951b256ad643113c6a8e (diff)
downloadtk-0cdb0677540aa8995226f52ec82b9037920b6d29.zip
tk-0cdb0677540aa8995226f52ec82b9037920b6d29.tar.gz
tk-0cdb0677540aa8995226f52ec82b9037920b6d29.tar.bz2
* tests/bind.test: Tweaked expected error messages for [bindtags]
to comply with updated error messages. * generic/tkMenu.c (CloneMenu): Replaced calls to Tk_BindtagsCmd with equivalent calls to Tk_BindtagsObjCmd. * generic/tkInt.h: Replace Tk_BindtagsCmd prototype with Tk_BindtagsObjCmd prototype. * generic/tkWindow.c: Updated "bindtags" command entry to use Tcl_Obj'ified command. * generic/tkCmds.c (Tk_BindtagsObjCmd): Tcl_Obj'ified [bindtags] command.
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 89525ed..0aac47e 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.7 2000/06/27 17:15:58 ericm Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.8 2000/08/03 20:36:16 ericm Exp $
*/
/*
@@ -2665,7 +2665,6 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
&& (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) {
TkMenu *newMenuPtr = menuRefPtr->menuPtr;
Tcl_Obj *newObjv[3];
- char *newArgv[3];
int i, numElements;
/*
@@ -2692,15 +2691,18 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
* clone structure.
*/
- newArgv[0] = "bindtags";
- newArgv[1] = Tk_PathName(newMenuPtr->tkwin);
- if (Tk_BindtagsCmd((ClientData)newMenuPtr->tkwin,
- newMenuPtr->interp, 2, newArgv) == TCL_OK) {
+ newObjv[0] = Tcl_NewStringObj("bindtags", -1);
+ newObjv[1] = Tcl_NewStringObj(Tk_PathName(newMenuPtr->tkwin), -1);
+ Tcl_IncrRefCount(newObjv[0]);
+ Tcl_IncrRefCount(newObjv[1]);
+ if (Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
+ newMenuPtr->interp, 2, newObjv) == TCL_OK) {
char *windowName;
Tcl_Obj *bindingsPtr =
Tcl_DuplicateObj(Tcl_GetObjResult(newMenuPtr->interp));
Tcl_Obj *elementPtr;
+ Tcl_IncrRefCount(bindingsPtr);
Tcl_ListObjLength(newMenuPtr->interp, bindingsPtr, &numElements);
for (i = 0; i < numElements; i++) {
Tcl_ListObjIndex(newMenuPtr->interp, bindingsPtr, i,
@@ -2713,14 +2715,16 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
Tcl_IncrRefCount(newElementPtr);
Tcl_ListObjReplace(menuPtr->interp, bindingsPtr,
i + 1, 0, 1, &newElementPtr);
- newArgv[2] = Tcl_GetStringFromObj(bindingsPtr, NULL);
- Tk_BindtagsCmd((ClientData)newMenuPtr->tkwin,
- menuPtr->interp, 3, newArgv);
+ newObjv[2] = bindingsPtr;
+ Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
+ menuPtr->interp, 3, newObjv);
break;
}
}
Tcl_DecrRefCount(bindingsPtr);
}
+ Tcl_DecrRefCount(newObjv[0]);
+ Tcl_DecrRefCount(newObjv[1]);
Tcl_ResetResult(menuPtr->interp);
/*