0

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];
Victor.V
  • 177
  • 1
  • 9

1 Answers1

0

According to Willeke comments, to detect if some Alert is running can be used next code:

if([NSApp modalWindow]) { 
  ...
}
Victor.V
  • 177
  • 1
  • 9