----- Original Message ---- From: Friedrich Romstedt <friedrichromst...@gmail.com> To: Lou Pecora <lou_boog2...@yahoo.com> Cc: matplotlib-users@lists.sourceforge.net Sent: Tue, January 25, 2011 7:40:23 AM Subject: Re: [Matplotlib-users] How to get a Mac OS X version of Tcl/Tk rather than X11 version.
2011/1/24 Lou Pecora <lou_boog2...@yahoo.com>: > I have an installation of Python 2.6.4 on my MacBook Pro (OS X 10.6) that by > default uses X11 windows and dialogs rather than the Mac version of those GUI > items. In my googling and exchanges on other support groups I've come down to > the problem may be with the Tcl/Tk installation using the "generic" X11 GUI > rather than the Mac version. Does anyone know how I can change that in the Tk > part of the python framework? > > I think this problem came up in the iPython email list, but I didn't get enough > info from the messages there. > > More Info: The python framework is part of the SAGE package which I installed > from source. I did this on my Mac Pro (system 10.4) and it works well with Mac > windows for matplotlib and Mac open/save dialogs for Tk calls. But on my > MacBook Pro I get X11 windows and dialogs. I want the Mac versions. > > Even more info: > > If you're interested, here's the original message I put up on the SAGE support > group and was told it's a problem with the type of Tcl/Tk installed. > > -- Lou Pecora [cut] I have a self-compiled Python 2.6.5 on Mac OS X 10.6.6, with self-compiled matplotlib. It shouldn't matter if mpl is self-compiled or not, since the TkAgg backend just uses the Python Tkinter module. mpl uses some blitter extension, but this shouldn't matter here too. I don't have Sage installed, and I know little about Sage. My Tkinter widgets, irrespective of mpl or not, have the Aqua look-and-feel. I know that, using the binary distribution package of Python 2.x I used before, I got *not real* Aqua look-and-feel, but it wasn't either X11 iirc (i.e. no X11 spawned; assumed that spawning X11 implies that is shows up in the Dock). With that binary, text boxes did not have Aqua boundaries, but I do not remember precisely how buttons looked like. Save dialogs were also not as you might want them to have; with the self-compiled Python, they are like in any other Mac app. I remeber vaguely that the Python binary Mac OS X packages are compiled agains an older Tcl/Tk, for support of Mac OS X 10.4. Anyway, all this is long ago. I tried this on my system: n0877:lib-dynload Friedrich$ pwd /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload n0877:lib-dynload Friedrich$ otool -L _tkinter.so _tkinter.so: /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7) /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) It tells you what Tcl/Tk frameworks the Tkinter binary module is linked against. Be warned that compiling mpl on Mac OS X 10.6 is a bit cumbersome due to compiler issues. Friedrich ------------------------------------------------------ Hi, Friedrich, You have given me the key to the solution to my problem. Thank you. The problem was that I had separate Tcl and Tk Frameworks installed and SAGE was using those. The solution is to remove those and re-build SAGE which then is smart enough to use the Apple supplied Tcl and Tk Frameworks. That gives what looks like the Aqua interface. However, it does not add in the Default Folder add-on that I have for open and save dialogs. But I can live without that. The X11 interface is gone. Below are instructions for others who might have this problem. Thanks, again. I ran your otool command on my Apple python installation down in /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload and got this output: _tkinter.so: /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7) /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) So my Apple python is under /System not /Library like yours. When I go to the SAGE folder and run otool on its lib-dynload folder I got _tkinter.so: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.9) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.9) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1) Note, these frameworks are down in the /Library folder which shows SAGE is building the Tk library on the Tcl and Tk frameworks I had installed earlier, not on the Apple versions down in /System folder. These solution is to remove the /Library Tcl and Tk frameworks and re-install SAGE. The only problem for some people might be that they might have built other things bases on the non-Apple Tcl and Tk frameworks. -- Lou Pecora ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users