• 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
NSButton subclass doesn't get performClick:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSButton subclass doesn't get performClick:


  • Subject: NSButton subclass doesn't get performClick:
  • From: Jerry Krinock <email@hidden>
  • Date: Sun, 05 Feb 2006 08:10:08 -0800
  • Thread-topic: NSButton subclass doesn't get performClick:

I've subclassed NSButton, and in it I've overridden performClick:, but it
does not get invoked when I click the button...

- (void)performClick:(id)sender {
    NSLog(@"Performing click on MyButton");
    return [super performClick:sender] ;
}

// But.....
- (id)initWithCoder:(NSCoder *)coder {
    NSLog(@"initWithCoder a MyButton") ;
    return [super initWithCoder:coder] ;
}

That NSLog in initWithCoder logs when the button is initialized, and my
"invented" methods in this subclass work OK.  So this subclass is definitely
functioning, but the NSLog in performClick: does not log when I click the
button.

I suppose my problem may be related to the explanation I see in the first
paragraph of NSButton documentation that NSButton methods are "covers" for
NSButtonCell, because performClick: is really an NSButtonCell method.

On the other hand, I read in the archives that overriding performClick: in
an "NSButton subclass" has been successfully done:

http://www.cocoabuilder.com/archive/message/cocoa/2005/3/28/131575

What might I be missing?  I looked at AMRolloverButton but Andreas does not
override performClick:, and if I add my performClick: NSLog test to
AMRolloverButton, it does not work there either.

Jerry Krinock

P.S.  My reason for overriding performClick is because I want to reduce the
highlighting time delay.


 _______________________________________________
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

  • Follow-Ups:
    • Re: NSButton subclass doesn't get performClick:
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: NSOutlineView Row Selection Color
  • Next by Date: first steps
  • Previous by thread: Re: Programmatically resized NSWindow not being redrawn?
  • Next by thread: Re: NSButton subclass doesn't get performClick:
  • Index(es):
    • Date
    • Thread