• 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
NSTextField selectors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField selectors


  • Subject: NSTextField selectors
  • From: Alex Reynolds <email@hidden>
  • Date: Fri, 20 Oct 2006 08:08:05 -0400

To follow up on my previous question, I am trying to do a [textField selectText:self] call inside my delegate object when the user presses Command-A inside my subclassed NSTextField object. I'd also like to restore other Command-keypresses: e.g., copy: on Command-C, paste: on Command-V, etc.

Here's the code I'm trying to use to make that happen:

- (BOOL) control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
if (command == @selector(selectAll:))
{
[textField selectText:self];
return YES;
}
return NO;
}


But this fails. In fact the only selectors I seem to be able to get are the result of pressing the Escape key (cancelOperation: and complete:).

Should I be using a different delegate method?

-Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Tab stop with fill characters
  • Next by Date: KVC with bindings to array elements?
  • Previous by thread: Re: Tab stop with fill characters
  • Next by thread: KVC with bindings to array elements?
  • Index(es):
    • Date
    • Thread