简体   繁体   中英

NSWindow going behind main window

I have a main window for my application. When a button is clicked I present another window (smaller one). This is shown above the main window by default. From the smaller window I have a option to navigate to a browser page. When I do this my both windows go to background and browser will be at the front. After that when I try to click my smaller window, it's coming behind the main window. I need it to come above main window. Is there any way out?

You can use addChildWindow:ordered:

After the childWindow is added as a child of the window, it is maintained in relative position indicated by orderingMode for subsequent ordering operations involving either window. While this attachment is active, moving childWindow will not cause the window to move (as in sliding a drawer in or out), but moving the window will cause childWindow to move.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM