mouseDown events
mouseDown events
- Subject: mouseDown events
- From: David Harper <email@hidden>
- Date: Wed, 27 Jun 2007 11:12:57 -0400 (EDT)
hi,
This problem I'm having really doesn't make sense to me. I'm working on a simple document-based application; the model is already written and I'm trying to implement the view. I need right mouse clicks to pop up a menu. But right mouse click events are not registered. Do I need to make my view the first responder or something?
The code I'm using to test the simple drop down menu is as follows. All clicks register except right mouse clicks.
-(void) mouseDown:(NSEvent *)theEvent {
printf("left mouse down: %d\n", [theEvent type]);
}
-(void) rightMouseDown:(NSEvent *)theEvent {
[NSMenu popUpContextMenu:[self menu] withEvent:theEvent forView:self];
printf("right mouse down\n");
}
-(void) otherMouseDown:(NSEvent *)theEvent {
printf("other mouse down\n");
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden