discuss-gnustep
[Top][All Lists]
Advanced

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

Re: About Preferences, Palette and Inspector Windows and Model/View Arch


From: Germán Arias
Subject: Re: About Preferences, Palette and Inspector Windows and Model/View Architecture
Date: Sat, 14 Mar 2009 10:52:05 -0600

El sáb, 14-03-2009 a las 14:49 +0200, Fred Morcos escribió:
> Hi all,
> 
> What I have right now is a Preferences dialog that is yet another 
> "NSDocument" in the application
> (basically I can open up several Preferences dialogs which is a bad
> thing). This is due to the AppController loading the Preferences
> window through [NSBundle loadNibNamed:owner:] so there is no control
> over the number of windows that can be loaded except with bad/dirty
> static counts. Same thing with Palette and Inspector windows. Any
> pointers, tutorials, docs for this? Same thing goes for
> multiple-window documents.

In the method that call the panel, you need something like this 

     if(panel == nil)
       {
       [NSBundle loadNibNamed: @"panel.gorm" owner: self] ;
       [panel makeKeyAndOrderFront: self] ;
       }
     else
       {
       [panel makeKeyAndOrderFront: self] ;
       }

This prevent many panels. 





reply via email to

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