Re: Changing up/down arrow behavior for NSTextField
Re: Changing up/down arrow behavior for NSTextField
- Subject: Re: Changing up/down arrow behavior for NSTextField
- From: Douglas Davidson <email@hidden>
- Date: Wed, 13 Feb 2008 10:34:32 -0800
On Feb 13, 2008, at 9:58 AM, Joshua Emmons wrote:
You don't want to override these methods directly in your field
editor because you might require different behavior for each field
in your app and the same field editor is used for all of them. But
remember that the text field that is being edited is the field
editor's delegate. So you can implement the delegate method -
textView:doCommandBySelector: in your text field and do the work
there instead.
I have just one thing to add: instead of subclassing NSTextField and
overriding textView:doCommandBySelector:, it may be easier to just
supply a delegate to the text field and implement the text field
delegate method
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView
doCommandBySelector:(SEL)commandSelector;
instead.
Douglas Davidson
_______________________________________________
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