Re: Capturing right button mouse clicks in NSMatrix
Re: Capturing right button mouse clicks in NSMatrix
- Subject: Re: Capturing right button mouse clicks in NSMatrix
- From: Jim Rankin <email@hidden>
- Date: Thu, 11 Apr 2002 09:53:48 -0400
You can make a subclass of NSMatrix and override mouseDown: with
something like this:
-(void)mouseDown:(NSEvent *)event {
if ([event modifierFlags]& NSRightMouseDownMask) {
/* your custom logic here */
} else
[super mouseDown:event];
}
This should test whether the right mouse button is down in the current
event and execute your code for that case if so. Otherwise, it just
calls the regular NSMatrix mouseDown: handler.
You may also need to call super's mouseDown: after your custom logic as
well, depending on what you want to do.
Best,
Jim Rankin
WebObjects/EOF/Cocoa/AppleScript Studio developer for hire
On Wednesday, April 10, 2002, at 05:48 PM, Oscar Morales Vivs wrote:
>
Which would be the best way to capture right button mouse clicks in a
>
NSMatrix the same way the left mouse clicks are captured?
>
>
It seems all the classes (NSCell, NSMatrix, NSButtonCell...) are set
>
for capturing left button clicks, and at most displaying a menu with
>
the right button.
>
>
Thanks in advance for your help.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.