11

I am working on an application for my personal usage that will remind me of stuff at regular intervals and/or will require text entry. Hence this popup window has an NSTextField.

If the window pop's up when I am in the middle of typing, my typing transfers to the popup window which is very annoying! Is there any way to stop this, currently I am using:

[NSApp activateIgnoringOtherApps:YES];
[hudWindow makeKeyAndOrderFront:nil];

I have also tried:

[NSApp activateIgnoringOtherApps:YES];
[hudWindow orderFrontRegardless];

Is there any other way to do it?

Jay
  • 19,649
  • 38
  • 121
  • 184

2 Answers2

6
[hudWindow orderFront: nil];

Moves the window to the front of its level in the screen list, without changing either the key window or the main window.

cocoafan
  • 4,884
  • 4
  • 37
  • 45
1

Did you try using setLevel:? Setting it to one of the higher levels should do the trick.

like

[hudWindow setLevel:NSFloatingWindowLevel];

Ken Aspeslagh
  • 11,484
  • 2
  • 36
  • 42