• 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: setting NSSlider floatvalue from different thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting NSSlider floatvalue from different thread


  • Subject: Re: setting NSSlider floatvalue from different thread
  • From: Karim Morsy <email@hidden>
  • Date: Wed, 15 Feb 2006 13:02:55 +0100

Hi,

This is the code for the callback functions that gets called repeatedly (about 50 times per second) on a seperate thread (which is not the main thread).
(I am trying to animate a slider according to specific float values, and I want to the slider to keep moving even if another button is pressed, which usually blocks the main thread)


{

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];


id mySlider= (id)inObject;
//[mySlider setFloatValue: inValue]; // obviously this is not allowed (according to the docs)

NSArray * arr= [NSArray arrayWithObject:NSEventTrackingRunLoopMode];

NSNumber *num= [NSNumber numberWithFloat:inValue];

[mySlider performSelectorOnMainThread:@selector(setObjectValue:) withObject:num waitUntilDone:NO modes:arr];

[pool release];
}



Nothing ever happens to the slider ... can anyone see what I am doing wrong ?


Thanks,
Karim
_______________________________________________
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: setting NSSlider floatvalue from different thread
      • From: j o a r <email@hidden>
    • Re: setting NSSlider floatvalue from different thread
      • From: Jack Nutting <email@hidden>
  • Prev by Date: Re: nsarraycontroller, bindings and big databases
  • Next by Date: Re: setting NSSlider floatvalue from different thread
  • Previous by thread: Re: setting NSSlider floatvalue from different thread
  • Next by thread: Re: setting NSSlider floatvalue from different thread
  • Index(es):
    • Date
    • Thread