Re: NSSlider mouseUp ????
Re: NSSlider mouseUp ????
- Subject: Re: NSSlider mouseUp ????
- From: Shaun Wexler <email@hidden>
- Date: Sat, 4 Mar 2006 15:02:46 -0800
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