I'm making an NSStatusItem with a custom view. In drawRect:, it draws things based on the value of the "highlighted" instance variable. When mouseDown: is called, it pops up a menu using the status item's popUpStatusItemMenu: method. Using the mouseUp: event does not work, because it is not called after the menu goes away. This is the way I've found that makes it work:

- (void)mouseDown:(NSEvent *)theEvent {
        highlighted = YES;
        [self setNeedsDisplay:YES];
        [statusItem popUpStatusItemMenu:menu];
        highlighted = NO;
        [self setNeedsDisplay:YES];
        [super mouseDown:theEvent];
}

Is this a good method, or is there something better that involves mouseUp:?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to