Python Tkinter without X11
Hello, I was trying to work through some examples of Tkinter usage in python, and realised that the Macports python24 and py-tkinter seem to require X11. Is there some way to do Carbon/ Aqua Tkinter using the Macports python? Is there some obvious place to look for documentation on this? Thanks, Max python24 @2.4.4_1+darwin_8 (active) py-tkinter @2.4.4_0 (active) -8<---------------------------------------------- $ python Python 2.4.4 (#1, Jun 15 2007, 10:53:01) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import Tkinter root = Tkinter.Tk() Traceback (most recent call last): File "<stdin>", line 1, in ? File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py", line 1569, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display ":0.0"
max.e.brown@gmail.com wrote:
Hello,
I was trying to work through some examples of Tkinter usage in python, and realised that the Macports python24 and py-tkinter seem to require X11. Is there some way to do Carbon/ Aqua Tkinter using the Macports python? Is there some obvious place to look for documentation on this?
Thanks,
Max
First, install the Aqua variant of Tk: sudo port install tk + aqua Then install python24 and py-tkinter. That worked for me. --- Kevin Walzer PortAuthority: The GUI for MacPorts http://www.codebykevin.com/portauthority.html
participants (2)
-
Kevin Walzer
-
max.e.brown@gmail.com