NSPopUpButton Notifications
NSPopUpButton Notifications
- Subject: NSPopUpButton Notifications
- From: MH <email@hidden>
- Date: Tue, 22 May 2007 14:30:21 +0100
i have a custom NSPopUpButton class as I need a notification on mouse
up event, but it doesn't seem to be working correctly.
Here's the class
@interface SCPopUpButton : NSPopUpButton {
}
- (void)mouseUp:(NSEvent *)theEvent;
@end
@implementation SCPopUpButton
- (id)init
{
self = [super init];
if (self != nil) {
// initialization code
}
return self;
}
- (void)mouseUp:(NSEvent *)theEvent {
// [super mouseUp:theEvent];
[[NSNotificationCenter defaultCenter]
postNotificationName:@"SCPopUpButtonUp" object:self];
}
@end
and here the MyDocument snippet from the init method to register
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(lightSelectionDidChange:)
name:@"SCPopUpButtonUp"
object:lightSelector];
Which doesn't seem to be working.
I'm aware of the NSPopUpNotification thats posted when a menu is first
clicked, but I need the mouseUp ideally. Can anyone see the problem?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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