Show NSwindow, hidden setHidesOnDeactivate?

I'm sure the answer should be pretty simple, but for some reason I can't get it to work!

I have a window and this code:

[someWindow setHidesOnDeactivate:YES];

I have a status item and the following code

- (void)openWindow{
   if ([someWindow isVisible]) {
         NSLog(@"CLOSING");
         [lyricWindow close];
   }else {
          [someWindow makeKeyAndOrderFront:nil];
         NSLog(@"SHOWING");
   }

}

It worked when I closed the window and wanted to open it again. Now that I have implemented hiding deactivation, I have lost what I need to do! I tried all kinds of things ... I want the window to appear again and the window to become active when I click on the status element! I think this is my problem.

How can I make a window active when I click on a status item?

I get the following in the log:

CLOSE SHOW CLOSE SHOW

, , , id guess isVisible false, . , . ?

!

+3
1

, , . NSPanel ( NSWindow), NSStatusItem.

, , NSPanel :

[NSApp arrangeInFront:sender];
[myWindow makeKeyAndOrderFront:sender];
[NSApp activateIgnoringOtherApps:YES];

, " ". , .

+8

All Articles