[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] Cocoa primitives




On Tuesday, December 17, 2002, at 10:27 AM, crucial felix wrote:

does it ? i thought by being in { }.defer from the client side where it was called,
that it cleverly and easily avoided that.

No. defer in the SC language and SCVirtualMachine's defer: method are different. If you make any blocking function call from inside the language it will stall the scheduling. Your primitive should post an NSInvocation using SCVirtualMachine's defer: method. Then that deferred method can call URLsFromRunningOpenPanel. When that finishes then you need to call back into the language to have the completion function called. You can get an idea of how this works by looking at prSCWindow_FullScreen, however there is no primitive yet which needs a result returned from a deferred operation like this one does so there is no complete example to do what you need.

--
--- james mccartney   james@xxxxxxxxxxxxxx   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the PowerMac.
<ftp://www.audiosynth.com/pub/updates/SC2.2.16.sea.hqx>