Re: NSTableView Cocoa Bindings tutorial (was: [Pyobjc-dev] NSTableView)
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2004-04-04 17:16:17
|
On Apr 4, 2004, at 9:34 AM, Paul Donovan wrote: > > On 4 Apr 2004, at 09:29, Bob Ippolito wrote: > >> I have created a small Cocoa Bindings example and step by step >> tutorial that uses NSTableView in response to this question. >> Hopefully it is enough to get people started. >> >> The example itself is in PyObjC CVS at >> Examples/CocoaBindings/TableBindings/ >> > > Thanks for creating this example, it was very timely as I was about to > look at bindings this weekend. > > The code doesn't appear to be in CVS though, although the PDF is > enough to work with. It's there. Sourceforge is slow about updating their anonymous repository though. > One question - if one didn't want to use dictionaries but use objects > with straightforward attributes, how would the code and bindings be > altered? I remember some talk on the list about getattr() or something > like that, but didn't really follow it as I hadn't investigated Cocoa > Bindings at that time. The short answer is that dictionaries are easy, because otherwise you are probably going to need something that subclasses NSObject. It should work if you use straightforward attributes, but you will probably have to declare that class in your nib, and you may have to use accessor methods for those attributes. For more information about how Cocoa Bindings works, read the other examples and Apple's documentation ( http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaBindings/ ). -bob |