[Pythonmac-SIG] Tkinter under Mac OSX

Michel Sanner Michel Sanner <sanner@scripps.edu>
Wed, 13 Nov 2002 10:11:20 -0800 (PST)


Dear Bob,

I saw your message on the Pythonmac SIG mailing list. I have been trying to 
support macOSX for my applications for quite some time now without much success. 
The main problem coming from Tkinter and using Togl. The closest I got so far 
was using a rootless X server. Since then it seems that support for macOSX has 
grown so I decided to give it a try again.

I got Tcl/tk 8.4.1 (since they claim AQUA support). I manage to compile and 
install it as a framework.
I got Python 2.2.2 compiled it and installed it as a Framework.

The first problem I had was that Tkinter had not been built. Since I am not sure 
how to alter setup.py for it to detect that it should build _tkinter.so I 
created Modules/Setup.local for this.

I tried several things (None of which worked) and tried the following code

>>> import Tkinter
>>> r = Tkinter.Tk()

1 - build without using -DTK_AQUA. The window appears but clicking on it or 
doing anything in the window prints an error message: failed to setFrontProcess

2 - build using TK_AQUA. For this to link I had to replace 
Tk_MacOSXOpenBundleResources by Tcl_MacOSXOpenBundleResources, but the code 
fails with a bus error on  Tcl_MacOSXOpenBundleResources.

The other approach I tried was to use a Python 2.2.1 interpreter built using 
fink and tcltk8.3 built using fink. This seemed to work as far as Tk goes but 
failed when I was adding Togl.
I built togl.so that work with tclsh. I am able to "package require Togl" 
successfully. But when I try to do this from within Tkinter it fails telling 
that togl.so is a badly formed mach 0 dynlib.

Any hint/advise would be very much appreciated.

-Michel

-----------------------------------------------------------------------

Michel F. Sanner Ph.D.                   The Scripps Research Institute
Assistant Professor			Department of Molecular Biology
					  10550 North Torrey Pines Road
Tel. (858) 784-2341				     La Jolla, CA 92037
Fax. (858) 784-2860
sanner@scripps.edu                        http://www.scripps.edu/sanner
-----------------------------------------------------------------------