Re: Overriding NSTextField keyDown?
Re: Overriding NSTextField keyDown?
- Subject: Re: Overriding NSTextField keyDown?
- From: Douglas Davidson <email@hidden>
- Date: Tue, 6 Jan 2009 13:10:17 -0800
On Jan 6, 2009, at 1:05 PM, Mr. Gecko wrote:
I didn't know this went up, I figured out how to do this like
saturday.
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView
doCommandBySelector:(SEL)commandSelector {
if ([NSStringFromSelector(commandSelector)
isEqualToString:@"insertNewline:"]) {
[self goToURL:self];
return YES;
}
return NO;
}
Something like that should do the trick. I should point out that you
can compare the selector you receive directly to
@selector(insertNewline:); you don't need to convert to strings.
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