• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multiple Nibs problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple Nibs problems


  • Subject: Multiple Nibs problems
  • From: Hasan Diwan <email@hidden>
  • Date: Fri, 6 Jun 2003 16:05:53 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm writing an application using multiple nibs (3 right now) : About.nib, Prefs.nib, and MainMenu.nib. About and Prefs are NSWindowController subclasses. Code for the About class is given below:
#import <Cocoa/Cocoa.h>
@interface About : NSWindowController {
IBOutlet NSTextField *version;
}
@end

@implementation About
- - (id)init {
self = [super initWithWindowNibName:@"About"];
return self;
}
- - (IBAction)closeWindow:(id)s {
[[self window] close];
}
- - (BOOL)shouldCascadeWindows {
return NO;
}
- - (void)windowDidLoad {
[version setStringValue:[NSString stringWithString:[[[NSBundle bundleForClass:[self class]] infoDictionary] objectForKey:@"CFBundleVersion"]]];
[[self window] setBackgroundColor:[NSColor whiteColor]];
[[self window] setFrameAutosaveName:@"About"];
[[self window] setFrameUsingName:@"About"];
}
@end
// end code
In my mainController class, I have an instance of About declared thusly:
About *about;
- - (IBAction)bringAboutBox:(id)sender {
if (!about) about = [[About alloc] init];
[about showWindow:self];
}
// end code snippet
The problem arises when testing the code, if I click the about menu item (which is supposed to show the panel), it doesn't do anything. Also, it grays out the other menu items in the Application menu, so the only way to quit is to use the Dock. The code for preferences is similar, but it works fine. Any pointers appreciated...
Hasan Diwan {http://ibn.com/~hdiwan}
OpenPGP Fingerprint: 275D 0E84 550C D92A 4A56 732C 8528 2579 E6E9 4842
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE+4R5YhSgleebpSEIRAkr3AJ4zs0cEm8scbC72LSLU7RUuGxD1/ACdGfyZ
2VFAxbZ9kB5DoCzOF0kF1sc=
=DKLY
-----END PGP SIGNATURE-----
_______________________________________________
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.

  • Follow-Ups:
    • Re: Multiple Nibs problems
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Project Builder recompiles all files all the time...
  • Next by Date: Re: Project Builder recompiles all files all the time...
  • Previous by thread: Re: Project Builder recompiles all files all the time...
  • Next by thread: Re: Multiple Nibs problems
  • Index(es):
    • Date
    • Thread