from __future__ import * 4.4.2004

2004-04-04

PyObjC, NSTableView, Cocoa Bindings Tutorial

I created a small Cocoa Bindings example in the PyObjC CVS repository last night, and decided to follow it up with a step by step tutorial. I figured this would be useful as the demonstration I gave during my PyCon talk isn't anywhere in my slides.

The tutorial assumes you are using PyObjC CVS (or whatever release comes after 1.1b1). In order to set up an appropriate environment you will have to perform the following steps:

  • Make sure you're running OS X 10.3 or later, and you have the latest Xcode installed. If not, it's time to upgrade. Cocoa Bindings are not available in previous versions of OS X.

  • Check out PyObjC CVS

  • sudo python setup.py install

  • Make the folder /Library/Application Support/Apple/Developer Tools/Project Templates

  • Copy Xcode/Project Templates/Cocoa-Python Application from your PyObjC checkout into that folder.

The finished example is in Examples/CocoaBindings/TableModel of the PyObjC source tree, but the tutorial (PasswdViewer Tutorial PDF) is self-contained so using the finished example is not going to teach you anything about Interface Builder or creating projects with the new template.

If you're interested in how I created the tutorial, here is the reStructuredText source document. Note that the screenshots are crucial to getting the hang of this, so you should really be using the PDF. I'll post the code I used to create the tutorial PDF (and my PyCon slides) at some point in the future if there is interest, but it's merely a small hack of the PythonPoint output code already in docutils CVS (somewhere in the sandbox).

posted at 19:02:24    #    comment []    trackback []
April
MoTuWeThFrSaSu
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
2627282930  
Mar May

Bob's Rants

XML-Image Letterimage

© 2004, Bob Ippolito