Re: Unable to launch about panel for the 2nd time

2008-09-24 Thread Jason Coco


On Sep 24, 2008, at 15:16 , I. Savant wrote:


On Wed, Sep 24, 2008 at 6:17 AM, Arun <[EMAIL PROTECTED]> wrote:

First time i am to see the panel being launched and if i close the  
panel and

try yo launch it one more time, the panel is not vsible.


 Your question was answered yesterday ... check the archives or your
spam filter.


Yeah, how rude :)

J

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Unable to launch about panel for the 2nd time

2008-09-24 Thread I. Savant
On Wed, Sep 24, 2008 at 6:17 AM, Arun <[EMAIL PROTECTED]> wrote:

> First time i am to see the panel being launched and if i close the panel and
> try yo launch it one more time, the panel is not vsible.

  Your question was answered yesterday ... check the archives or your
spam filter.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Unable to launch about panel for the 2nd time

2008-09-23 Thread Jason Coco


On Sep 23, 2008, at 02:58 , Arun wrote:


Hi All,

I am a newbie to cocoa programming.
I have written a small program in which i will be loading a Custom  
About

panel from another nib.
This launching of the panel works well only for the first time.
If i close the panel and try to launch for the 2nd time, it is  
unable to

show the panel.
Can anyone let me know what is wrong in the code?

Attaching the code along with this mail.


Another thing that you may want to look into is NSWindowController...  
especially in this simple case, I think it's a better choice than
your own subclass of NSObject. For just this simple about panel, you  
probably wouldn't even need to subclass it. To use it, just
create it with your window nib and in your window nib make file's  
owner an instance of NSWindowController or (if you decide to

subclass it) an instance of your subclass.

You can read more about NSWindowController at: 
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindowController_Class/Reference/Reference.html

Jason

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Unable to launch about panel for the 2nd time

2008-09-23 Thread Jason Coco


On Sep 23, 2008, at 02:58 , Arun wrote:


Hi All,

I am a newbie to cocoa programming.
I have written a small program in which i will be loading a Custom  
About

panel from another nib.
This launching of the panel works well only for the first time.
If i close the panel and try to launch for the 2nd time, it is  
unable to

show the panel.
Can anyone let me know what is wrong in the code?

Attaching the code along with this mail.

Thanks in advance..!!!


Hi Arun,

The problem is that you're AboutPanel nib is wired-up a bit wrong.  
Since you're loading the instance yourself, you don't want to create
the AboutPanelController object *inside* the nib. This is what the  
File's Owner object is for. To correct your issue keeping (mostly) the

same code as in your small example project, make these changes:

In AbouPanel.nib:

1) Delete the instance of AboutPanelController
2) Select File's Owner and open the inspector; under the Identity  
panel, change the Class to AboutPanelController

3) Wire your File's Owner mPanelToDisplay outlet to the panel in the nib
4) (optional since you don't do any delegate methods at the moment)  
wire your panel's delegate outlet to File's Owner

5) Save (and optionally quit IB)

In AboutPanelController.mm:

1) In the method implementation for sharedInstance, change line 20 to  
the following line (change marked in bold):


if (YES == [NSBundle loadNibNamed:@"AbouPanel.nib"  
owner:sharedInstance];


2) save and rebuild -- this should now work as expected

In this case, you want your sharedInstance variable to actually be the  
file's owner so that it can receive messages meant for the panel in  
the nib. You don't want
the class itself to be the file's owner since you're actually creating  
an instance of the class here.


HTH, Jason 

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]