• 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
Re: Right (or cntl)-clicking a button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right (or cntl)-clicking a button


  • Subject: Re: Right (or cntl)-clicking a button
  • From: Sherm Pendley <email@hidden>
  • Date: Sat, 19 Apr 2003 09:16:42 -0400

On Saturday, April 19, 2003, at 07:20 AM, Bill Cheeseman wrote:

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 &&)?

Yes, it should. Mail.app should have a compiler in it... :-(

And why not just [NSApp currentEvent], instead of [[sender window]
currentEvent] -- in other words, is there any reason why it matters which
you use?

I found it first in NSWindow, so that's what I tend to use, just out of habit. I don't think it makes a difference.

sherm--

C programmers never die - they're just cast into void.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Right (or cntl)-clicking a button
      • From: Greg Hurrell <email@hidden>
References: 
 >Re: Right (or cntl)-clicking a button (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Convert an NSAttributedString to HTML
  • Next by Date: Re: Convert an NSAttributedString to HTML
  • Previous by thread: Re: Right (or cntl)-clicking a button
  • Next by thread: Re: Right (or cntl)-clicking a button
  • Index(es):
    • Date
    • Thread