Re: Right (or cntl)-clicking a button
Re: Right (or cntl)-clicking a button
- Subject: Re: Right (or cntl)-clicking a button
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 19 Apr 2003 07:20:35 -0400
on 03-04-18 10:40 PM, Sherm Pendley at email@hidden wrote:
>
Here's some example code. All the usual caveats apply - typed in email,
>
untested, etc.:
>
>
- (IBACTION) buttonClicked: (NSButton) sender {
>
if ([[[sender window] currentEvent] modifierFlags] &&
>
NSControlKeyMask) {
>
// Handle control-click
>
} else {
>
// Handle ordinary click
>
}
>
}
Shouldn't that be a bitwise and (&, not &&)?
And why not just [NSApp currentEvent], instead of [[sender window]
currentEvent] -- in other words, is there any reason why it matters which
you use?
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.