[Pythonmac-SIG] Carbon GUI/MacPython

Kevin Ollivier kevino at tulane.edu
Fri Aug 13 21:48:19 CEST 2004


Hi Kevin and all,

On Aug 12, 2004, at 9:06 PM, Bob Ippolito wrote:

> On Aug 12, 2004, at 11:24 PM, Kevin Walzer wrote:
>
>> I'm curious as to why the Carbon side of MacPython doesn't seem to be
>> updated, at least with regard to GUI programming. Earlier, when I
>> queried the list about the W widget set and some related questions, I
>> was advised that these were deprecated and would likely go away at 
>> some
>> point in the future. It was also mentioned that MacPython (the 
>> PythonIDE
>> and PackageManager) are dependent on the Waste module, which also 
>> seems
>> obsolete.
>
> W is just *barely* Carbon.  It predates Carbon and doesn't do things 
> the Carbon way (especially wrt. event loops).  PythonIDE predates 
> Carbon too, and PackageManager uses W (I think, anyway).  Nobody wants 
> to work on them because overhauling ancient code isn't very much fun, 
> neither is working with Carbon.
>
> I'm pretty sure there's a PyObjC replacement for PackageManager 
> complete or near-complete, and there was a wxPython version of it 
> floating around a while ago.  There isn't an official PythonIDE 
> replacement yet, but there is PyOXIDE (written mostly(?) in ObjC, 
> though).

Just as a FYI, the wxPython Package Manager is still around at: 
http://www.theolliviers.com/python/wxpm/. Probably next weekend I'll 
look at re-building the bundle with bundlebuilder2 and wxPython 2.5.2, 
which should be released by Monday. (You can check the wxPython-dev 
archives at http://lists.wxwidgets.org to find a link to the latest RC 
release.)

On the Carbon side, being someone who works with Carbon and Python 
myself, I have to say that I really think wxPython is actually the best 
option for "Carbon" programming on Mac, plus you get cross-platform 
apps to boot. wxWidgets/wxPython developers have always had the 
philosophy that we should embrace the native platform as much as 
possible, and while there's always room for improvement, we're already 
taking advantage of HIView and Carbon Events pretty extensively, and I 
think when 2.5.2 is released you will notice the difference from 
previous releases because of that. As a couple examples of Mac-specific 
features 2.5.2 has off the top of my head, wx.TextCtrl now works with 
the Services menu, and you can support files dropped on the app icon by 
overriding the wx.App.MacOpenFile(filename) AppleEvent handler. I don't 
think either Tk or W is being as actively developed for Mac.

There's more on the way as well. For example, I plan on having both 
Mozilla and WebKit working reasonably well within wxPython on Mac in 
the next couple months.

Of course, whether or not you need PyObjC or wxPython really depends 
upon your needs and what you're comfortable with. But I think you'll 
find yourself running into walls with W, because as Bob says there 
isn't much demand for using the Carbon (and pre-Carbon) APIs for GUI 
programming these days, particularly with Python. Without much demand, 
it's hard for anyone to justify spending the time maintaining and 
updating the Carbon API wrappers. (And it is a lot of work, with Apple 
releasing major updates to their APIs every 12-18 months now.) I think 
you're better off going either cross-platform (wxPython) or 
Cocoa/PyObjC.

HTH,

Kevin



More information about the Pythonmac-SIG mailing list