Re: NSTextView attachments and context menus
Re: NSTextView attachments and context menus
- Subject: Re: NSTextView attachments and context menus
- From: Martin Hewitson <email@hidden>
- Date: Tue, 9 Mar 2010 19:58:33 +0100
On Mar 9, 2010, at 9:18 AM, Martin Wierschin wrote:
> 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.
Great! Thanks,
Martin
>
> I hope that helps,
>
> ~Martin
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
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