summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-10 17:42:51 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-10 17:42:51 (GMT)
commit062cfb0c4e804a6c0d5d9d1711abdcfb1882e200 (patch)
tree23f4ed0da46af6a4d6af9eebb846b7ac43a2e00e /Modules
parent58b6873f6b348ca4511ac8fa01bed76b049f6ec5 (diff)
downloadcpython-062cfb0c4e804a6c0d5d9d1711abdcfb1882e200.zip
cpython-062cfb0c4e804a6c0d5d9d1711abdcfb1882e200.tar.gz
cpython-062cfb0c4e804a6c0d5d9d1711abdcfb1882e200.tar.bz2
added interface to Tk_DoOneEvent (R Lindsay Todd)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 77b1809..96a1c93 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1031,6 +1031,26 @@ Tkapp_MainLoop (self, args)
}
static PyObject *
+Tkapp_DoOneEvent (self, args)
+ PyObject *self;
+ PyObject *args;
+{
+ int flags;
+ int rv;
+
+ if (PyArg_Parse (args, ""))
+ flags = TK_ALL_EVENTS;
+ else
+ {
+ PyErr_Clear();
+ if (!PyArg_Parse (args, "i", &flags))
+ return NULL;
+ }
+ rv = Tk_DoOneEvent(flags);
+ return Py_BuildValue ("i", rv);
+}
+
+static PyObject *
Tkapp_Quit (self, args)
PyObject *self;
PyObject *args;
@@ -1076,6 +1096,7 @@ static PyMethodDef Tkapp_methods[] =
{"deletefilehandler", Tkapp_DeleteFileHandler},
{"createtimerhandler", Tkapp_CreateTimerHandler},
{"mainloop", Tkapp_MainLoop},
+ {"dooneevent", Tkapp_DoOneEvent},
{"quit", Tkapp_Quit},
{NULL, NULL}
};
@@ -1165,6 +1186,7 @@ static PyMethodDef moduleMethods[] =
{"deletefilehandler", Tkapp_DeleteFileHandler},
{"createtimerhandler", Tkapp_CreateTimerHandler},
{"mainloop", Tkapp_MainLoop},
+ {"dooneevent", Tkapp_DoOneEvent},
{"quit", Tkapp_Quit},
{NULL, NULL}
};
@@ -1216,6 +1238,18 @@ PyInit_tkinter ()
PyDict_SetItemString (d, "WRITABLE", v);
v = Py_BuildValue ("i", TK_EXCEPTION);
PyDict_SetItemString (d, "EXCEPTION", v);
+ v = Py_BuildValue ("i", TK_X_EVENTS);
+ PyDict_SetItemString (d, "X_EVENTS", v);
+ v = Py_BuildValue ("i", TK_FILE_EVENTS);
+ PyDict_SetItemString (d, "FILE_EVENTS", v);
+ v = Py_BuildValue ("i", TK_TIMER_EVENTS);
+ PyDict_SetItemString (d, "TIMER_EVENTS", v);
+ v = Py_BuildValue ("i", TK_IDLE_EVENTS);
+ PyDict_SetItemString (d, "IDLE_EVENTS", v);
+ v = Py_BuildValue ("i", TK_ALL_EVENTS);
+ PyDict_SetItemString (d, "ALL_EVENTS", v);
+ v = Py_BuildValue ("i", TK_DONT_WAIT);
+ PyDict_SetItemString (d, "DONT_WAIT", v);
#ifdef WITH_READLINE
rl_event_hook = EventHook;