Multiple Nibs help?
Multiple Nibs help?
- Subject: Multiple Nibs help?
- From: Hasan Diwan <email@hidden>
- Date: Wed, 8 Oct 2003 17:40:47 -0400
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.