How can I programmatically force a mac window to be the front window? I have the window handle, and want to ensure that my window is displayed above all other windows. I can use both Carbon & Cocoa for this.
See Question&Answers more detail:osHow can I programmatically force a mac window to be the front window? I have the window handle, and want to ensure that my window is displayed above all other windows. I can use both Carbon & Cocoa for this.
See Question&Answers more detail:osFor Cocoa, you can set the window level using:
[window setLevel:NSFloatingWindowLevel];
A floating window will display above all other regular windows, even if your app isn't active.
If you want to make your app active, you can use:
[NSApp activateIgnoringOtherApps:YES];
and
[window makeKeyAndOrderFront:nil];