Question

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?

Était-ce utile?

La solution

-[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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top