No that's not true. You need to set a goal and action for the status element in order to call a method that does what you want (opens a window).
// This goes where you set up the status item NSStatusItem *statusItem; // You need to get this from the status bar [statusItem setTarget:self]; [statusItem setAction:@selector(openWindow:)]; // This method is called when the status item is clicked - (void)openWindow:(id)sender { NSWindow *window = [self window]; // Get the window to open [window makeKeyAndOrderFront:nil]; }
You can also call [NSApp activateIgnoringOtherApps:nil]; to your openWindow method: to make sure that the window that opens is not behind another application window.
ughoavgfhw
source share