Re: Multiple Nibs help?
Re: Multiple Nibs help?
- Subject: Re: Multiple Nibs help?
- From: Amul Goswamy <email@hidden>
- Date: Wed, 8 Oct 2003 15:02:20 -0700
I'm not certain what your problem is. Is it that the key command
doesn't work? Shouldn't the newURL method have an (id)sender argument?
Amul Goswamy
Interface Builder QA
On Oct 8, 2003, at 2:40 PM, Hasan Diwan wrote:
I have a window with a webview as my Document, it displays fine. I've
put a small window with an NSTextField in a second nib. I'd like this
window to drop down as a sheet. When I load the Nib, the code is
loaded and everything is initialised properly. I have included a code
snippet below; problems are illustrated in the comments:
// MyDocument.m
- (id) init {
self = [super init];
if (self) {
[NSBundle loadNibNamed:@"NewURL" owner:self]; // NewURL.nib contains
the window with the textfield
}
return self;
}
- (void)windowControllerDidLoadNibName:(NSString *)s {
[super windowControllerDidLoadNibName:s];
[[[[NSApp mainMenu] itemWithTitle:@"File"] submenu]
addItemWithTitle:@"Open URL" action:@selector(newURL:)
keyEquivalent:@"l"]; // keyEquivalent doesn't seem to have any effect
either
- (IBAction) newURL {
[NSApp beginSheet:newURLWindow forModal:window modalDelegate:self
didEndSelector:NULL contextInfo:nil];
[NSApp runModalForWindow:newURLWindow];
[NSApp endSheet:newURLWindow];
}
- (IBAction)urlFieldAction:(id)s {
[web takeStringURLFrom:s];
}
Help!
Hasan Diwan {http://ibn.com/~hdiwan}
OpenPGP Fingerprint: 275D 0E84 550C D92A 4A56 732C 8528 2579 E6E9 4842
_______________________________________________
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.
_______________________________________________
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.