summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorericm <ericm@noemail.net>2000-08-03 20:36:15 (GMT)
committerericm <ericm@noemail.net>2000-08-03 20:36:15 (GMT)
commit96de7fd1aa5ce7dcd4868b91ba15859e6a0cbbb1 (patch)
treeff2867076396bc073331bbed420d5ef47e09b88e /generic/tkMenu.c
parent3dc95d924fa44d8208cd5815af5024d865c0178d (diff)
downloadtk-96de7fd1aa5ce7dcd4868b91ba15859e6a0cbbb1.zip
tk-96de7fd1aa5ce7dcd4868b91ba15859e6a0cbbb1.tar.gz
tk-96de7fd1aa5ce7dcd4868b91ba15859e6a0cbbb1.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. FossilOrigin-Name: 1bf52b230a4740dbd765dd60d1a6015e318e1c44
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);
/*