Re: [Pyobjc-dev] interface builder queries
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2003-08-26 16:51:12
|
On Aug 26, 2003, at 9:28 AM, Ronald Oussoren wrote: >> 2) How hard is it to generate/manipulate NIBs programmatically? >> They're mostly NSArchivered lumps of data, right? The point behind >> this question is that I have a description of various data formats >> and it might save time to generate a really clunky interface from >> this description, and then turn it into a less clunky interface by >> monkeying about in IB (but not have to sort *all* those connections >> out by hand). > > I don't know, but I'd like to know. Please tell us if you find out :-) Given that you want to do the manipulation with a goal of writing out a NIB file that can subsequently be monkeyed about with in IB, you will be nicely surprised. Look in the InterfaceBuilder.framework. API is provided for making/breaking connections and otherwise manipulating the object graph found within a NIB file. It should provide most/all of the features you need. I would suggest writing an InterfaceBuilder Palette (using PyObjC, of course -- but you'll need a framework build of Python) that contains the tools needed to modify the object graph of your NIB files (or produce the object graph). Point of reference: about a year ago, I helped a company port their NeXTSTEP 3.3 code and interface files forward to OS X. We used OpenStep 4.2 as a go-between for NIB conversion and, as a result, were able to convert-- including object graph manipulation-- all 100+ NIB files (20,000+ custom objects across the NIBs) from NS 3.3 to OS X. This also required re-arranging views and changing object configurations to help convert the NS 3.3 look-n-feel to OS X. There are some gotchas and tricks, but it does work and works very well.... b.bum |