Display alert sheet when application is not active
Display alert sheet when application is not active
- Subject: Display alert sheet when application is not active
- From: Luc Van Bogaert <email@hidden>
- Date: Sun, 11 Nov 2012 13:09:59 +0100
Hi,
For my NSDocument based application, I'm trying to display an alert as a sheet on the document window when the user drops a file on a custom view in that window.
In the custom view implementation, I'm sending a message from performDragOperation: to the current document's windowcontroller to display the alert sheet. This works fine if my application is active when the user drops the file on the view.
However, when my application is not active when the file is dropped, the message to the windowcontroller is never sent.
Here's the relevant line of code in performDragOperation:
[[[[[NSDocumentController sharedDocumentController] currentDocument] windowControllers] objectAtIndex:0]
alertImageDragInDesignWithURL:[NSURL URLFromPasteboard:pboard]];
I've found a workaround by activating my app in the view's draggingEntered: method, but I'd rather not take focus away from the user like this.
Any help would be appreciated.
--
Luc Van Bogaert
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden