Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CptnJustc

macrumors 6502
Original poster
Jan 19, 2007
343
206
Hi there, moderate newbie here, so please forgive me if I'm missing something basic. I did my best to search for an answer, but couldn't find something that matched what I'm doing.

I'm making a menulet (using this example as a base), with one of the menu options launching a customized NSPanel. Unfortunately, I just can't get the panel to appear. I've tried two methods:

First, something basic, launched directly from the application controller.
Code:
[NSBundle loadNibNamed:@"MyPanel" owner:self];
[myPanel makeKeyAndOrderFront:nil];
This seems to create a ghost menulet with no associated panel or anything else. I've tried subclassing NSPanel and overriding canBecomeKeyWindow to return YES, but that seems to have no effect.

Second, I've tried giving it its own controller class:
Code:
- (id)init
{
    self = [super initWithWindowNibName:@"MyPanel"];
    return self;
}
Then launching it by instantiating the class:
Code:
    if (!myPanelController) {
        myPanelController = [[myPanelController alloc] init];
    }
    [myPanelController showWindow:self];

This at least doesn't create a ghost menulet, but it doesn't seem to do much else. Any ideas would be greatly appreciated....
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.