[Pythonmac-SIG] Re: X11 and Tkinter (was: Beginner's questions)

Jack Jansen Jack.Jansen at cwi.nl
Tue Dec 30 15:39:53 EST 2003


On 30-dec-03, at 19:19, Russell E Owen wrote:

>> On 29-dec-03, at 18:19, Russell E Owen wrote:
>>>> Note that you can also do this without installing a second Python. 
>>>> If
>>>> you put _tkinter.so for X11 in, say, ~/Library/X11-Python and you 
>>>> add
>>>> that directory to $PYTHONPATH. You could create a script x11python
>>>> containing
>>>>
>>>> 	#!/bin/sh
>>>> 	PYTHONPATH=~/Library/X11-Python:$PYTHONPATH
>>>> 	exec /usr/bin/python "$@"
>>>>
>>>> should do the trick, I think (untested).
>>>
>>> That is a very interesting idea. I suppose one could do an x11 build 
>>> of python, extract _tkinter.so and then discard the build, thus 
>>> saving disk space and clutter over keeping two builds. But...might 
>>> there some simpler way to obtain an x11-based _tkinter.so?
>>
>> Actually, it would be reasonably simple to create a PackMan package 
>> that contains an X11 _tkinter, puts it in 
>> /Library/Python/2.3/X11-Python and puts an x11python script in 
>> /usr/local/bin.
>>
>> How much interest would there be in such a thing?
>
> I would gladly use it.
>
> But it does raise a few issues that I fear may make it too much work 
> to justify the effort:
> - One would need an X11 build of Tcl/Tk, making installation a bit 
> complicated. I don't know of any MacOS X binary installer for X11 
> Tcl/Tk (other than fink).

Bah, I forgot about that:-(

That makes it too much work, indeed. Unless someone can provide an 
installer that installs X11 Tcl/Tk, that is.

> - How would it work with packages that rely on Tkinter, such as IDLE? 
> Could they easily be convinced to run "either way" (x11 or aqua) or 
> would one need a separate build of each?

This shouldn't be too much of a problem, only one of organisation. 
Depending on which _tkinter comes first in sys.path you'll get X11-Tk 
or Aqua-Tk.
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Pythonmac-SIG mailing list