NSPanel owned by NSDocumentController: cause of a problem?
NSPanel owned by NSDocumentController: cause of a problem?
- Subject: NSPanel owned by NSDocumentController: cause of a problem?
- From: Gerben Wierda <email@hidden>
- Date: Thu, 28 Feb 2002 00:47:11 +0100
I override the method newDocument in my NSDocumentController subclass.
- (IBAction)newDocument:(id)sender
{
if (openMPanel == nil)
{
// we need to load the nib
if ([NSBundle loadNibNamed:@"OpenMPanel" owner:self] == NO)
{
NSRunAlertPanel(@"Error", @"Could not load OpenMPanel.nib",
@"Accept defeat", nil, nil);
return;
}
}
[openMPanel makeKeyAndOrderFront:self];
}
This works as in that I get my Panel, I enter something in a NSTextField
in it and hit OK, and I receive the message since I have connected the
OK button in the Panel to a method in the the file's owner.
So far so good.
But what does not work are all the edit functions (copy, paste, cut) on
the text field. The menu items are grayed out when the panel is active.
Somehow, I suspect that it has to do with the owner of my NSBundle.
Also: in IB the delegate of this Panel is the Owner, which is again my
NSDocumentController subclass.
I am looking for a way to get the edit functions working in my Panel,
but the documentation has not enlightened me so far. What triggers the
availability of those menu items (that are in another nib of course). Is
there some way I can get my Panel connected to the menu item in that
other (main) nib? Is there something I shoul ddo with the responder
chain, maybe?
Thanks,
G
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.