[Pythonmac-SIG] needed: simple gui toolkit with "japaneseinput" support

has hengist.podd at virgin.net
Tue Apr 11 15:25:22 CEST 2006


Dethe Elza wrote:

>Kent Quirk
> > Which is kinda the point -- you already knew Cocoa and wanted to use it in a different context.
>
>Can't speak for Ronald (he's already spoken anyhow), but I learned
>Cocoa from Python.

Ditto here (art school graduate and self-taught coder, btw). I'm familiar with assembling GUI widgets via drag-n-drop (the easy bit) in IB from having used AppleScript Studio a bit, and I know just enough C that I can look at ObjC code and work out what it does when I need to. Plus I already understood basic MVC theory before I started, which is a good idea if you're building anything fancy, though this is the first time I've seriously put it into practice. However, in terms of learning how to define View-Controller connections in IB and learning the Cocoa APIs and design patterns I've done all that while in Python+PyObjC.

Took me two whole days to wrap my mind around actions, outlets and custom classes in IB and how those related to the code I wrote in my .py files. But I'm relatively slow on the uptake, and once I cracked it I found it quite easy to work with and certainly preferable to writing View code by hand. The rest I've been picking up along the way as needed (AppKiDo rocks!:): creating my own NSDocument subclasses; shifting controller code into NSWindowController subclasses; using NSNotificationCenter to handle Model->Controller communication according to MVC rules; adding window toolbars, drawers, split-views, etc. I've a copy of Hillegass kicking around, but so far I've only looked up a few things in the index; mostly I just pull apart the existing PyObjC examples and learn from those.

While it would be nice if there was a gentler, hand-holding environment like FaceSpan specifically for novice and lightweight users [1][2], Python+Cocoa really isn't too bad once you get over the initial intimidation. I put off learning Cocoa for a year or two worrying about how hard it would be, but once I sat down and spent a week or so with it it I found it was actually far less scary as I'd imagined it would be. Like most big application frameworks it just takes a little time and patience to find your bearings. The only real up-front requirements is that you need to be comfortable with object-oriented design and programming and can follow other peoples' abstractions.

HTH

has

[1] Incidentally, while the current version of FaceSpan doesn't support third-party (i.e. not AppleScript) OSA languages, I believe the next version probably will - meaning you could write FaceSpan-based apps in a variety of languages. The only catch is that there isn't a really good, complete Python OSA component available yet (though there's a couple of potential candidates).

[2] AppleScript Studio should be able to use an alternative OSA language with a little judicious hacking, although the Studio APIs are a bit crap anyway (more a poor man's version of Cocoa than a next-generation HyperCard) so I'm not sure you'd be better off with that than PyObjC. Though again, until there's a suitable Python OSA component this is all academic anyway.
-- 
http://freespace.virgin.net/hamish.sanderson/


More information about the Pythonmac-SIG mailing list