Custom field editor context menu
Custom field editor context menu
- Subject: Custom field editor context menu
- From: "Rimas M." <email@hidden>
- Date: Mon, 7 Jun 2010 23:28:27 +0300
Hello list,
Congrats on WWDC week. Have great sessions :)
I have some troubles implementing custom context menu in NSTextField.
While field is editing, field editor take control over field. So I
implemented my custom field editor:
- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client
{
if (sender && client are OK)
{
static MyCustomFieldEditorView *_editor = nil;
if (_editor == nil)
{
_editor = [[MyCustomFieldEditorView alloc]
initWithFrame:[(NSTextField*)client frame]];
}
[_editor setMenu:[(NSTextField*)client menu]];
return _editor;
}
return nil;
}
Field editor is replaced with my own one, my menu is displayed. Great.
But that works if there is no selected text in editor. But if any, I
am getting:
Spelling suggestion 1
Spelling suggestion 2
...
Spelling suggestion N
-----
Ignore Spelling
Learn Spelling
-----
Search in Spotlight
Search in Google
-----
Look up in Dictionary
-----
My Custom menu item 1
...
My Custom menu item N
I want menu to have only my custom items. No spelling & co above my
items. Always. Even with some text selected.
How could I achieve that?
Any help is very appreciate.
Regards,
Rimas M.
_______________________________________________
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