CPSlider and MouseDown

14 views
Skip to first unread message

Elias

unread,
Nov 6, 2009, 5:11:45 AM11/6/09
to Cappuccino & Objective-J
Hi,

I have a CPTimer running in my app and I want to invalidate it
whenever I start sliding on a certain CPSlider.
After the slide is finished I want to start the CPTimer again.

Is that possible? How would you do that? Is there any onMouseDown
action I can call?

Regards

Elias

Elias

unread,
Nov 9, 2009, 3:09:44 AM11/9/09
to Cappuccino & Objective-J
Any idea?

E.

tim payton

unread,
Nov 24, 2009, 8:39:54 AM11/24/09
to Cappuccino & Objective-J
I would recommend using a notification center... whenever the slider
is moved, it sends a notification that the timer is observing..
And when you finish sliding the same thing.
I'm still pretty basic myself, but this seems like a pretty good
solution.

I think the screencast tutorials even have a slider sending
notifications episode :)

Elias

unread,
Nov 24, 2009, 4:40:27 PM11/24/09
to Cappuccino & Objective-J
Thats exactly how I'd do it but I think CPSlider only fires a method
when the knob is moving.
I can't see any method or delegate which knows when you are at sliding
and when you are finished sliding.

Maybe I'll wrap the slider in a custom CPControl view which can tell
when there's a MouseDown / MouseUp.

Elias

tim payton

unread,
Nov 25, 2009, 11:57:55 AM11/25/09
to Cappuccino & Objective-J
sorry, didn't know that :)
the wrapper things sounds doable...

can you just invalidate the timer when the slider starts moving, and
when it stops moving ?
stopTracking:at:mouseIsUp:

??
Reply all
Reply to author
Forward
0 new messages