• 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
no control of NSSlider interval
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: no control of NSSlider interval
      • From: "Simon Strandgaard" <email@hidden>
  • Prev by Date: Re: Application design & menu question
  • Next by Date: Re: Obtain computer model
  • Previous by thread: Re: Using NSUserDefaults for Other Apps' Preferences
  • Next by thread: Re: no control of NSSlider interval
  • Index(es):
    • Date
    • Thread