fractor
fractor

Reputation: 1650

NSTextField without the Services menu item

I have a custom subclass of NSTextField. I want to display a context menu on right-click but the menu displays a completely irrelevant Services menu. I understand this is added due to OS settings, but the options are of no use at all in my scenario (e.g. the text fields contain numeric values) and it just adds clutter.

I have overridden textView:menu:forEvent:atIndex: to currently return nil. This means no menu is displayed, which is preferable to the Services menu in my view. However if I try to return an NSMenu instance containing items I actually want, then a Services menu item gets added.

Is there any way for my application or individual text fields to opt out of this?

Upvotes: 1

Views: 416

Answers (1)

Willeke
Willeke

Reputation: 15589

See allowsContextMenuPlugIns

Indicates whether the pop-up menu allows appending of contextual menu plug-in items.

Upvotes: 2

Related Questions