summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-29 13:59:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-29 13:59:18 (GMT)
commit637ea03ab047c97e3a8e0c5ed58b010e8142874b (patch)
tree8ed0761ccc67000d150d6e1f472085cd6c52408d /generic/tkMenu.c
parente4f9fece815b8121b9300c83a9697f2b2ea27e9f (diff)
downloadtk-637ea03ab047c97e3a8e0c5ed58b010e8142874b.zip
tk-637ea03ab047c97e3a8e0c5ed58b010e8142874b.tar.gz
tk-637ea03ab047c97e3a8e0c5ed58b010e8142874b.tar.bz2
Make "menu" a normal command, initialized like any other Tk command.
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 484352a..cd9ff08 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -353,8 +353,6 @@ static int MenuDoXPosition(Tcl_Interp *interp,
static int MenuAddOrInsert(Tcl_Interp *interp,
TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc,
Tcl_Obj *const objv[]);
-static int MenuCmd(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
static void MenuCmdDeletedProc(ClientData clientData);
static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, int index, int type);
static char * MenuVarProc(ClientData clientData,
@@ -385,37 +383,7 @@ static const Tk_ClassProcs menuClass = {
/*
*--------------------------------------------------------------
*
- * TkCreateMenuCmd --
- *
- * Called by Tk at initialization time to create the menu command.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * See the user documentation.
- *
- *--------------------------------------------------------------
- */
-
-int
-TkCreateMenuCmd(
- Tcl_Interp *interp) /* Interpreter we are creating the command
- * in. */
-{
- Tcl_CreateObjCommand(interp, "menu", MenuCmd, NULL, 0);
-
- if (Tcl_IsSafe(interp)) {
- Tcl_HideCommand(interp, "menu", "menu");
- }
-
- return TCL_OK;
-}
-
-/*
- *--------------------------------------------------------------
- *
- * MenuCmd --
+ * Tk_MenuObjCmd --
*
* This function is invoked to process the "menu" Tcl command. See the
* user documentation for details on what it does.
@@ -429,14 +397,14 @@ TkCreateMenuCmd(
*--------------------------------------------------------------
*/
-static int
-MenuCmd(
- ClientData clientData, /* Not used */
+int
+Tk_MenuObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
{
- Tk_Window tkwin = Tk_MainWindow(interp);
+ Tk_Window tkwin = clientData;
Tk_Window newWin;
register TkMenu *menuPtr;
TkMenuReferences *menuRefPtr;