diff Modules/_tkinter.c @ 6343:689de613ea1c legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Sun, 28 Sep 1997 05:52:41 +0000
parents 13fbd98d81cc
children 9e46ecf03c3e
line wrap: on
line diff
--- a/Modules/_tkinter.c	Sun Sep 28 05:45:40 1997 +0000
+++ b/Modules/_tkinter.c	Sun Sep 28 05:52:41 1997 +0000
@@ -1265,7 +1265,7 @@
 	       !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 @@
 		   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);