I'm implementing a WebView delegate method called 
webView:contextMenuItemsForElement:defaultMenuItems:. It gives me a proposed 
list of items for the web view's contextual menu, and allows me to modify the 
list as I see fit before the menu is presented on-screen.

I iterate through the list and cherry-pick the ones I want to keep. I do this 
by examining the tag of each menu item and comparing it to one of the constants 
provided for this purpose:

enum {
    WebMenuItemTagOpenLinkInNewWindow=1,
    WebMenuItemTagDownloadLinkToDisk,
    WebMenuItemTagCopyLinkToClipboard,
    WebMenuItemTagOpenImageInNewWindow,
    WebMenuItemTagDownloadImageToDisk,
etc.

My problem is that there isn't a WebMenuItemTag constant for the "Speech" menu 
item. I do see that menu item in the proposed list, with a tag of 2015. Is this 
constant defined elsewhere? I looked in vain in the docs for NSTextView, which 
has a similar delegate method. I also searched for API names containing 
"MenuItemTag" and even "speech".

I don't mind filing a Radar requesting such a constant, but first I wanted to 
check whether I'm missing something.

--Andy


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to