[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using a shared AppController with Gorm

From: Gregory John Casamento
Subject: Re: Using a shared AppController with Gorm
Date: Mon, 25 Oct 2004 15:17:47 -0700 (PDT)


--- sanchezn <> wrote:
> Hello,
> I've a main gorm file in my application. I've created an AppController
> class in gorm. This AppController is the delegate of the application
> and controls the window and different objects in it.
> I want to use a shared instance of AppController but I don't know how
> to make Gorm understanding that.
> Somebody have an idea ?

Could you clarify you mean by a "shared instance" of AppController?   But
assuming you mean some of the common cases...

If you mean in one .gorm file, this is easy.  All you need to do is select the
class in the classes outline and instantiate it using Alt-I or by going to the
classes menu and selecting Instantiate.  This should put one instance of this
class in your objects view for each time you do this.  

If you want that instance of to act as the controller for another .gorm file,
then you should set the "NSOwner" or File's Owner (as it would be called in IB)
to your class.   You do this by selecting NSOwner and going to the inspector,
then go to the "Custom Class" inspector and select AppController from the list.
 When you subsequently load that nib from AppController you need to do:

[NSBundle loadNibNamed: "MainMenu" owner: self];

where self is the instance of AppController and MainMenu is the .gorm file
being loaded.

Much of this is covered in the Gorm documentation.  If you have tex/texinfo
installed you should be able to render the pdf manual which contains this.  
There is also a copy of it on the website (which I should update) if you don't
want to install these tools to make the docs which you can just download and

I hope this helps.

Please write to me if you have any further questions.

Thanks, GJC

Gregory John Casamento 
-- CEO/President Open Logic Corp. (A Maryland Corporation)
#### Maintainer of Gorm for GNUstep.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]