NSButton subclass doesn't get performClick:
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