• 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: NSSlider mouseUp ????
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSlider mouseUp ????


  • Subject: Re: NSSlider mouseUp ????
  • From: Scott Anguish <email@hidden>
  • Date: Sat, 4 Mar 2006 18:12:21 -0500

ah, sorry. I thought the sound was only supposed to play at mouseUp. (I had mentioned the short-circuited event loop in an earlier email)

On Mar 4, 2006, at 6:02 PM, Shaun Wexler wrote:

On Mar 4, 2006, at 2:51 PM, Scott Anguish wrote:

On Mar 15, 2006, at 7:17 AM, Nik Youdale wrote:

Yeah, I tried that.

I found that overriding the mouseDown method re-enables mouseUp (obviously), but as soon as i called the super implementation, the event eating would take place once more, effectively disabling mouseUp. So the sound would start playing, with no problems at all, but would never stop, because i don't know when to stop it.


right.. but what I'm saying is, can you not do this?

- (void)mouseDown:(NSEvent *)theEvent
{
	[super mouseDown:theEvent];
	// now play the sound
}

Not quite; the reason all of those won't work is that NSSlider runs its own event-tracking runloop during the mousedown which ends upon mouseup, thus capturing that event. This should work:


// myNoisySlider.m

- (void)mouseDown:(NSEvent *)theEvent
{
    [mySliderSound play];
    [super mouseDown:theEvent];
    [mySliderSound stop];
}

~HTH~  ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com

"A person who never made a mistake never tried anything new." - Albert Einstein



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSSlider mouseUp ???? (From: Nik Youdale <email@hidden>)
 >Re: NSSlider mouseUp ???? (From: Scott Anguish <email@hidden>)
 >Re: NSSlider mouseUp ???? (From: Nik Youdale <email@hidden>)
 >Re: NSSlider mouseUp ???? (From: Scott Anguish <email@hidden>)
 >Re: NSSlider mouseUp ???? (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: Unable to access customized NSView's accessor method
  • Next by Date: Unable to access customized NSView's accessor method
  • Previous by thread: Re: NSSlider mouseUp ????
  • Next by thread: Re: NSSlider mouseUp ????
  • Index(es):
    • Date
    • Thread