How to activate a window without a title

I can send a message to makeKeyAndOrderFront: make the window active. However, if I send this to a window without a title, it will not activate it. Is there a way to make a window without an active title bar?

+4
source share
1 answer

You need to override -canBecomeKeyWindow in a subclass of NSWindow to return YES .

In accordance with the documents:

Attempts to make the window a key window are abandoned if this method returns NO. The NSWindow implementation returns YES if the window has a title bar or a resize panel, or NO otherwise.

+4
source

Source: https://habr.com/ru/post/1383202/


All Articles