• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Overriding NSTextField keyDown?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Overriding NSTextField keyDown?
      • From: "Mr. Gecko" <email@hidden>
References: 
 >Overriding NSTextField keyDown? (From: "Mr. Gecko" <email@hidden>)
 >Re: Overriding NSTextField keyDown? (From: Douglas Davidson <email@hidden>)
 >Re: Overriding NSTextField keyDown? (From: "Mr. Gecko" <email@hidden>)

  • Prev by Date: Re: Overriding NSTextField keyDown?
  • Next by Date: Re: Overriding NSTextField keyDown?
  • Previous by thread: Re: Overriding NSTextField keyDown?
  • Next by thread: Re: Overriding NSTextField keyDown?
  • Index(es):
    • Date
    • Thread