Pergunta

I'm trying to figure out how to make an application popup front and above all other windows. That may have been a poor explanation so basically I want the app to act like quicksilver or alfred when a shortcut key is hit.

I couldn't find anything that looked like I wanted in NSWindow... Did I miss something?

Foi útil?

Solução

Even more specifically, something like:

[newWindow setLevel:NSFloatingWindowLevel];
[newWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];

...will work; the second line is probably additional behavior that you would want, allowing the window to be shown in every space and not just isolated to one.

Also note that in terms of window levels, anything above NSFloatingWindowLevel will work; it is better to used a named constant for clarity.

Outras dicas

You can set the level of an NSWindow using setLevel:. The possible constants are listed here, but you can set any integer you want.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top