Skip to content

Commit

Permalink
Add a new method of interpreter objects, interpaddr(). This returns
Browse files Browse the repository at this point in the history
the address of the Tcl interpreter object, as an integer.  Not very
useful for the Python programmer, but this can be called by another C
extension that needs to make calls into the Tcl/Tk C API and needs to
get the address of the Tcl interpreter object.  A simple cast of the
return value to (Tcl_Interp *) will do the trick now.
  • Loading branch information
gvanrossum committed Apr 29, 1998
1 parent 06245ac commit 9d1b7ae
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Modules/_tkinter.c
Expand Up @@ -1346,6 +1346,18 @@ Tkapp_Quit(self, args)
return Py_None;
}

static PyObject *
Tkapp_InterpAddr(self, args)
PyObject *self;
PyObject *args;
{

if (!PyArg_ParseTuple(args, ""))
return NULL;

return PyInt_FromLong((long)Tkapp_Interp(self));
}



/**** Tkapp Method List ****/
Expand Down Expand Up @@ -1385,6 +1397,7 @@ static PyMethodDef Tkapp_methods[] =
{"mainloop", Tkapp_MainLoop, 1},
{"dooneevent", Tkapp_DoOneEvent, 1},
{"quit", Tkapp_Quit, 1},
{"interpaddr", Tkapp_InterpAddr, 1},
{NULL, NULL}
};

Expand Down

0 comments on commit 9d1b7ae

Please sign in to comment.