I have NSWindow with custom NSView. This custom NSView override performDragOperation method. Drag-and-drop operations works good. But when I create and show NSAlert as modal window I need block drag-and-drop, method, performDragOperation shouldn't be called.
NSAlert *alert = [[NSAlert alloc]init];
[alert addButtonWithTitle:@"Excellent"];
[alert setMessageText:@"This is your message."];
[alert runModal];
One of possible solution is add code that verify if dialog is shown to performDragOperation method. But how to detect if NSAlert is shown. For example for sheet I can use:
if([window attachedSheet]) {
...
}
But how do this for
[alert runModal];
NSApplication
has a propertymodalWindow
. – Willeke