简体   繁体   中英

Pop dialog in front of an active open file dialog

When the user opens some files, I use the open event in order to make some operations before enabling him to actually open. For that I have a progress dialog.

However, my dialog is always opened behind the open file dialog.

I've added the following code to windowDidLoad of my NSWindowController :

[NSApp activateIgnoringOtherApps:YES];
[[NSApplication sharedApplication] runModalForWindow:self.window];

But it didn't make any impact.

Open dialog: 打开对话框

How can I display my dialog in front? Note that my dialog is opened after it and closed before it.

在评论的帮助下,我发现在显示窗口之前添加以下行解决了该问题:

self.window.level = NSPopUpMenuWindowLevel;

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