• 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: Notification for mouse-up on NSStepper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notification for mouse-up on NSStepper


  • Subject: Re: Notification for mouse-up on NSStepper
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 7 Dec 2007 15:31:52 +0000

On 7 Dec 2007, at 14:56, glenn andreas wrote:

You can do this:

- (void) mouseDown: (NSEvent *) event
{
	[super mouseDown: event];
	if ([[NSApp currentEvent] type] == NSLeftMouseUp) {
		[self doSomethingAfterTracking];
	}
}
- (void) mouseUp: (NSEvent *) event
{
	[self doSomethingAfterTracking];
}

So if the super's mouseDown does the tracking loop, the current event will be the mouse up (that stopped the tracking loop). If it doesn't, then mouseUp will be called like normal.

Hmmm. I hadn't thought of checking -currentEvent. If we assume that there are no guarantees from Apple, it's better than doing nothing, though I think it still isn't completely robust wrt changes in the superclass.


Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

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


  • Follow-Ups:
    • Re: Notification for mouse-up on NSStepper
      • From: John Stiles <email@hidden>
References: 
 >Notification for mouse-up on NSStepper (From: John Stiles <email@hidden>)
 >Re: Notification for mouse-up on NSStepper (From: Alastair Houghton <email@hidden>)
 >Re: Notification for mouse-up on NSStepper (From: glenn andreas <email@hidden>)

  • Prev by Date: Removing layer-backed NSViews
  • Next by Date: Re: how to instantiate MyDocument with file from open panel?
  • Previous by thread: Re: Notification for mouse-up on NSStepper
  • Next by thread: Re: Notification for mouse-up on NSStepper
  • Index(es):
    • Date
    • Thread