Re: NSTextView attachments and context menus
Re: NSTextView attachments and context menus
- Subject: Re: NSTextView attachments and context menus
- From: Martin Wierschin <email@hidden>
- Date: Tue, 9 Mar 2010 00:18:53 -0800
Hello Martin,
Now I want to offer the user a context menu to perform operations on
the attachment (open, save, etc). So far I was unable to find a way
to intercept a 'right-click' on the nstextview to offer a custom
context menu.
You can subclass NSTextView and override "menuForEvent:",
introspecting the NSEvent and selection as you see fit.
The context menu that appears has two additional menu items: "Import
Image" and "Capture Selection from Screen".
Before you display your menu, call [menu
setAllowsContextMenuPlugIns:NO] to disable those kinds of additions.
I hope that helps,
~Martin
_______________________________________________
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