Building a library with functions with callbacks

Trevor DeVore lists at mangomultimedia.com
Mon Jul 11 18:43:59 EDT 2005


On Jul 11, 2005, at 3:08 PM, Alex Tweedly wrote:
>
> I'm sure I've done this before, but can't remember where, and can't  
> figure out how to do it again.
> Sigh :-(      Another CRAFT day :-)
>
> I want to build a library where some of the functions in it have  
> parameters which are callbacks;
>   agtMyFunction pData, pCallBackMessage
>
> the functions will return immediately, and later when the right  
> circumstances exist, the library will send pCallBackMessage to the  
> object which called the library.
> (i.e. just like the callbacks on the socket library).
>
> How do you find which object *called* the library ?  (not "target 
> ()" - that's the object that originally received a message - if its  
> script has called a handler in, say, the card script and that calls  
> the library, then I need to find the card, not the original object)

Would executionContexts work in this case?


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com




More information about the use-livecode mailing list