I have an app winth one window and one panel, attached to this window.
steps:
- deactivate my app (app opened, but without the focus)
- click on a button on panel (panel is focused now, but main window is not)
How to set focus to the main window (parent window) from the panel?
It is not clear what you mean by focus, and whether what you call main window is a main window as defined in Cocoa. Assuming it is a Cocoa main window and focus is the same as key status,
or
If it is not a Cocoa main window, you need to have a reference to it and send it
-makeKeyWindow
or-makeKeyAndOrderFront:
.