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

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


  • Follow-Ups:
    • Re: NSPopUpButton Notifications
      • From: Sam Stigler <email@hidden>
  • Prev by Date: Re: Cutsom NSRulerView : strange problems with drawing
  • Next by Date: Re: NSPopUpButton Notifications
  • Previous by thread: Re: Cutsom NSRulerView : strange problems with drawing
  • Next by thread: Re: NSPopUpButton Notifications
  • Index(es):
    • Date
    • Thread