NSTextField selectors

  • 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
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today