no control of NSSlider interval
no control of NSSlider interval
- Subject: no control of NSSlider interval
- From: "Simon Strandgaard" <email@hidden>
- Date: Wed, 27 Sep 2006 01:32:43 +0200
Hi Cocoa Humans :-)
How does one shorten the interval of NSSlider?
The interval on my computer is 0.025 seconds, so allows in theory
for max 40 events per second. My opengl thread updates with 75 FPS.
In practice the number of events I see peeks at 30 per second
(using mouse intensively), which I guess is vsync related?
When I do something more advanced than memcpy, like generating
a testpattern controlled by the slider (this takes 20 msec).
Then my testpattern generator is invoked in average 16 times per
second.
Back to the original question. I have tried overloading getPeriodicDelay:
but I cannot control the interval (no half second delay).
@interface SlowSliderCell : NSSliderCell
@end
@implementation SlowSliderCell
-(void)getPeriodicDelay:(float*)delay interval:(float*)interval {
if(delay) *delay = 0.5f;
if(interval) *interval = 0.5f;
}
@end
elsewhere I install it like this (which I think works ok)
[_slider setCell: [[SlowSliderCell alloc] init]];
Any ideas for improvements?
regards
Simon Strandgaard
_______________________________________________
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