Re: tkinter problem: no Button events

Rich Neitzel (
9 Jun 1994 18:31:12 GMT

In article <>, Bill Janssen
<> writes:
|> files. I then turned to the Extensions/tkinter directory, and rebuilt a
|> python image containing tkinter, using the same shared libraries for Tcl
|> 7.3 and Tk 3.6 I'd been using previously. After a few build problems
|> (see earlier message), I got a python image, and tried it out by
|> importing the "tst" module, which sure enough brought up a window. It
|> seems to be active, because moving the pointer in it causes it to spit
|> out location tuples to stdout, but button presses don't work. I deleted
|> everything and re-built; same results. Any ideas?
Well, your patch that allowed dynamic linking of python with Tk/Tcl got me
started in the right direction. I too could not get button events, etc.
Looking at the source for Tk/Tcl, I found that Tcl_AppInt is coded in
both. Your patch seems to have been based on the Tcl version. I added 3
lines from the Tk version, recompiled and now have everything fine (so
far!). I repost Bill's patch with my addition below.
Richard Neitzel          Torren med sitt skjegg
National Center For Atmospheric Research        lokkar borni under sole-vegg
Box 3000 Boulder, CO 80307-3000	                Gjx'i med sitt shinn
303-497-2057                                    jagar borni inn.
--- tkintermodule.c.FCS Sat Jun  4 02:41:52 1994
+++ tkintermodule.c     Thu Jun  9 12:20:17 1994
@@ -149,6 +149,21 @@
   return v;
+    Tcl_Interp *interp;                /* Interpreter for application. */
+    if (Tcl_Init(interp) == TCL_ERROR) {
+       return TCL_ERROR;
+    }
+    if (Tk_Init(interp) == TCL_ERROR) {
+        return TCL_ERROR;
+    }
+    return TCL_OK;
 /*** Tkapp Object ***/
 /* Initialize the Tk application; see the `main' function in