As far as I know, sheets modal for a certain window without "freezing" the app can only be NSSavePanels, NSOpenPanels, and NSAlerts windows (since NSAlert isn't a NSWindow or NSPanel subclass but it has an associated window); if I wanted a generic NSPanel to be such a sheet, for example, I couldn't prevent it from freezing the app since the only (?) way to start that sheet is using

[NSApp beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:]

So, is there any way to set a generic panel as a sheet without freezing the entire app?

有帮助吗?

解决方案

-[beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:] for you with an NSPanel without difficulty.

However, if you have multiple windows on the same document, NSApp will block all windows within that document, since it's actually Document modal, not Window modal.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top