[comp.sys.next] "File's Owner" object in interfact builder

mcdonald@fornax.UUCP (Ken Mcdonald) (04/24/91)

Does anyone understand the use of the "File's Owner" object given in the
window along with the suitcases and such, in Interface Builder?  I've read
the docs and this, and still don't have a clue exactly what the use of
this object is.  Am I supposed to use it as if it were my Application Object?

And, just out of curiousity, is anyone else out there as irked as I am at some
of the interface oddities of Interface Builder?  Things like the incorporation
of both the object and class browser in a single window confused me for quite
a while--I was never quite sure why sometimes items in the pulldown menus
were greyed out, while at other times they were active.  The difficulty in
figuring out how to take instances of subclasses of predefined interface
classes.  That sort of thing.

Thanks in advance,
Ken McDonald
.

aozer@next.com (Ali Ozer) (04/25/91)

In article <2571@fornax.UUCP> mcdonald@fornax.UUCP (Ken Mcdonald) writes:
>Does anyone understand the use of the "File's Owner" object given in the
>window along with the suitcases and such, in Interface Builder?  I've read
>the docs and this, and still don't have a clue exactly what the use of
>this object is.  Am I supposed to use it as if it were my Application Object?

The file's owner object is the object specified as the owner in the
loadNib call which is loading this nib file.  Your app's default nib
file is loaded in main(): 

    [NXApp loadNibSection:"MyApp.nib" owner:NXApp];

Thus, for the default nib file, the owner is the Application object.
However, you will usually load other nib files during the execution of the
app (to get various auxillary panels, document windows, etc). Then you
might have another object specified as the owner:

    [NXApp loadNibSection:"Document.nib" owner:someObject withNames:NO];
    
The owner is the object which contains the outlet variables for the various
outlets in the nib. For instance, if you are loading a nib file containing
a document window, by the time the nib is loaded you'd want to have a handle
to the window; you'd accomplish this by an instance variable in the document
object that's an outlet to the window.

I believe some of the examples demonstrate this; most load info panels
this way, and some also use this method for document windows and such.

Performance hints: Use the withNames: argument to 
loadNibSection:owner:withNames: and set it to NO to avoid reading all the
object names in. Prevents lots of small mallocs. Also use the zone:
argument to take advantage of the zone facility to get better localization.

Ali, Ali_Ozer@NeXT.com

eht@cs.cmu.edu (Eric Thayer) (04/27/91)

In article <566@rosie.NeXT.COM> aozer@next.com (Ali Ozer) writes:
> In article <2571@fornax.UUCP> mcdonald@fornax.UUCP (Ken Mcdonald) writes:
[question about what "File's Owner" means in IB deleted]
[Ali Ozer's good explanation of what "Files's Owner" means deleted]

All I can to what Ali Ozer has said is the an example of just the situation he  
describes can be found in SoundDocument.m and SoundDocument.nib in  
/NextDeveloper/Examples/SoundEditor.  In this case, SoundDocument instances are  
owners of SoundDocument.nib.  I found it worthwhile to study and think about  
this code.

..eric

akcs.crew@ddsw1.MCS.COM (Christopher Wicklein) (05/03/91)

   I am wondering if a NeXT machine would be a good choice as successor to
my Apple IIGS. What is the suggested model/configuration for basic
productivity and C programming, and what is the price? Also, what are the
other UNIX machines available today that don't cost an arm and a leg?