[Edu-sig] OLPC related: pyGTK for cross-platform (Mac especially)?
Paul D. Fernhout
pdfernhout at kurtz-fernhout.com
Mon Dec 18 13:56:46 CET 2006
I'm still in a state of flux about where to go next after PataPata Phase I
(recently discussed here). Assuming I continue with Python (rather than
moving more towards Smalltalk, either Squeak or one for the JVM), what
interests me most is working on cross-platform applications (Mac, PC,
GNU/Linux). Fro cross-platform work, I prefer Jython & Swing over a Python
plus widget set solution. This is because Swing is cross platform, Sun has
announced plans to put lots of Java under the GPL, the JVM lets me ship
very portable Java code alongside the Jython code if needed for
performance, and we have already used Jython in cross-platform Mac, PC,
GNU/Linux commercial projects with some success (we've only used Python +
wxWidgets on PC and GNU/Linux, not Mac).
However, for the areas I am interested in, especially educational
simulations, being able to run on the One Laptop Per Child (OLPC) platform
would be a nice motivating plus. However OLPC does not currently run Java.
And with its resource constraints, the best choice for the OLPC is the
mainline supported system, which is Python 2.4 (maybe later) and GTK+.
http://wiki.laptop.org/go/OLPC_Python_Environment
(Some variant of Squeak Smalltalk is another possibility too, as there is
work on that.)
http://wiki.laptop.org/go/Etoys
Now, I don't *need* to support OLPC, and the JVM might run there someday,
but I would say that is my biggest sticking point going forward with
Jython/Swing if I stick with Python over Smalltalk. Our garden simulator
especially is a natural match for the OLPC goals (and we have previously
had people in various developing nations interested in it).
So, I know I brought up this topic of PyGTK etc. before only about six
months ago, but the computing landscape continues to change rapidly. So,
what do people have to say now about using GTK+ (which the OLPC supports)
for cross platform educational work these days, especially on the Mac and
PC (since GNU/Linux support will be excellent)?
Previously when I asked this there was a big groan from the Macintosh side
of the Python educational community (at least from Brad Miller, see
below). However, since then there is a continuing move for Aqua support
for GTK. See:
http://developer.imendio.com/projects/gtk-macosx
"This is the project site for the effort to port Gtk+ 2 to Mac OS X
natively (so that you can run Gtk+ applications without X11 on Mac OS X)."
And from::
http://www.pygtk.org/
"PyGTK 2.10.0 includes the following new features: ... MacOS X support"
Brad Miller had written back in June:
http://mail.python.org/pipermail/edu-sig/2006-June/006571.html
"There is some work in GTK+ 2.9.x to get a native port of GTK working on
the mac. Maybe when this effort is finally successful then native
versions of vpython and other packages will be easier. .. But I also think
that the effort required to get everything working under X11 would be too
difficult for many beginners."
So, is this still true six months later for shipping pyGTK based
applications? Or should GTK now be considered a reasonable choice for
applications to run under Mac and GNU/Linux? Anyone out there having easy
success with pyGTK applications on the Macintosh? And if it works, is it
still too bleeding edge to count on?
As for Windows, it's long been working OK there as an easy install, right?
Still, the installations I see seem to be separate packages, so it is not
as easy as with wxWidgets, where I bundle the wxPython & wxWidgets
libraries with the Windows application, right?
So, I guess my general question is, is pyGTK now an acceptable choice for
applications that want to run on Mac, PC, GNU/Linux and the OLPC project?
And if it is not, perhaps because of the Mac, is it likely within, say,
six months of being an easy install on the Mac? (Software takes a long
time to write and debug, so that time frame is reasonable for
cross-platform support.)
For reference, my most recent google search:
http://groups.google.com/group/comp.lang.python/search?q=mac+pygtk&start=0&scoring=d&hl=en&
turns up this comment:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/2ceb94790c8077c2/4339b2fc9f2fba95?lnk=gst&q=mac+pygtk&rnum=1&hl=en#4339b2fc9f2fba95
"GTK is being ported to Aqua, but the port it is in its early stages."
And also:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/2ceb94790c8077c2/20f9a2e4e653f5b9?q=mac+pygtk&lnk=nl&hl=en&
"GTK 2.8 uses an abstraction layer for drawing widgets called "Cairo".
Cairo can use OpenGL or Quartz as backends (still experimental). Thus, you
can get a hardware-accelerated GUI from PyGTK if you are willing to use an
experimental backend in Cairo."
In any case, moving forward, for me, in Python, I think the choices are
down to Jython + Swing vs. Python + pyGTK (assuming I don't try to write
code at a level of abstraction that make the system mostly widget
independent :-).
--Paul Fernhout
More information about the Edu-sig
mailing list