summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-09-28 05:52:41 (GMT)
committerGuido van Rossum <guido@python.org>1997-09-28 05:52:41 (GMT)
commit54e2091ba25c449c0b591d92d40ddcb2a9cb153e (patch)
tree23eaa1a94f7a3f67743a4baac0075f5c42f62f1d /Modules/_tkinter.c
parenta9f02b8badc3d8c31c10cdd3cebffaa5d2d10c23 (diff)
downloadcpython-54e2091ba25c449c0b591d92d40ddcb2a9cb153e.zip
cpython-54e2091ba25c449c0b591d92d40ddcb2a9cb153e.tar.gz
cpython-54e2091ba25c449c0b591d92d40ddcb2a9cb153e.tar.bz2
Add an optional hack for threads in Tkinter.
This one works! However it requires using a modified version of tclNotify.c (provided), which requires access to the Tcl source to compile it. In order to enable this hack, add the following to the Setup line for _tkinter: tclNotify.c -DHAVE_PYTCL_WAITUNTILEVENT -I$(TCL)/generic where TCL points to the source tree of Tcl 8.0. Other versions of Tcl are not supported. The tclNotify.c file is copyrighted by Sun Microsystems; the licensing terms are in the file license.terms. According to this file, no further permission to distribute this is required, provided the file license.terms is included. Hence, I am checking that in, too.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 04150d1..1307053 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1265,7 +1265,7 @@ Tkapp_MainLoop(self, args)
!errorInCmd)
{
int result;
-#ifdef THIS_CODE_IS_BUGGY
+#ifdef HAVE_PYTCL_WAITUNTILEVENT
result = Tcl_DoOneEvent(TCL_DONT_WAIT);
if (PyErr_CheckSignals() != 0)
return NULL;
@@ -1275,7 +1275,7 @@ Tkapp_MainLoop(self, args)
thread-safe, but it seems *rather* safe as long as
no two threads call mainloop() simultaneously. */
Py_BEGIN_ALLOW_THREADS
- result = Tcl_WaitForEvent((Tcl_Time *)NULL);
+ result = PyTcl_WaitUntilEvent();
Py_END_ALLOW_THREADS
#else
result = Tcl_DoOneEvent(0);