summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-09-22 23:49:28 (GMT)
committerGuido van Rossum <guido@python.org>1995-09-22 23:49:28 (GMT)
commit9722ad88838a743f02da3597e07ec016ecbf2a38 (patch)
tree9ca619d62a01ec016bf4978f1e089cfc4b2d9a6a
parent453534a84d51b96a77424a1a292b9ef37803e433 (diff)
downloadcpython-9722ad88838a743f02da3597e07ec016ecbf2a38.zip
cpython-9722ad88838a743f02da3597e07ec016ecbf2a38.tar.gz
cpython-9722ad88838a743f02da3597e07ec016ecbf2a38.tar.bz2
Mac changes
-rw-r--r--Modules/_tkinter.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 1709f69..5825eff 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1,7 +1,15 @@
/* tkintermodule.c -- Interface to libtk.a and libtcl.a.
Copyright (C) 1994 Steen Lumholt */
-#include <Python.h>
+#include "Python.h"
+
+#ifdef macintosh
+#define MAC_TCL
+#endif
+
+#ifdef MAC_TCL
+#define WITH_APPINIT
+#endif
#define PyInit_tkinter inittkinter
@@ -10,9 +18,17 @@
extern char *getprogramname ();
-/* Internal declarations from tkInt.h. */
+/* Internal declarations from tkInt.h. */
+#if (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION) >= 4001
+extern int Tk_GetNumMainWindows();
+#else
extern int tk_NumMainWindows;
+#define Tk_GetNumMainWindows() (tk_NumMainWindows)
+#endif
+
+#if TK_MAJOR_VERSION < 4
extern struct { Tk_Window win; } *tkMainWindowList;
+#endif
/**** Tkapp Object Declaration ****/
@@ -1009,7 +1025,7 @@ Tkapp_MainLoop (self, args)
return NULL;
quitMainLoop = 0;
- while (tk_NumMainWindows > threshold && !quitMainLoop && !errorInCmd)
+ while (Tk_GetNumMainWindows() > threshold && !quitMainLoop && !errorInCmd)
{
if (PyOS_InterruptOccurred ())
{
@@ -1184,7 +1200,7 @@ EventHook ()
excInCmd = valInCmd = trbInCmd = NULL;
PyErr_Print ();
}
- if (tk_NumMainWindows > 0)
+ if (Tk_GetNumMainWindows() > 0)
Tk_DoOneEvent (TK_DONT_WAIT);
return 0;
}
@@ -1255,3 +1271,21 @@ PyInit_tkinter ()
if (PyErr_Occurred ())
Py_FatalError ("can't initialize module tkinter");
}
+
+#ifdef macintosh
+void
+panic(char * format, ...)
+{
+ va_list varg;
+
+ va_start(varg, format);
+
+ vfprintf(stderr, format, varg);
+ (void) fflush(stderr);
+
+ va_end(varg);
+
+ Py_FatalError("Tcl/Tk panic");
+}
+
+#endif