Hi all - I'm bashing my head against the wall a little bit trying to determine exactly how to specify/define a reference to the 'receiver' object in a call to typedmess().
I've been looking at the following code from Peter on the forums, which is helpful but not quite enough for me to connect all the dots.
static Symbol* sSymThrough = NIL;
Object* thing = (Object*) iRecip->s_thing;
// Initialize our static symbol first time through
if (sSymThrough == NIL)
sSymThrough = gensym("through");
// Make sure we have a vaild thing
if (thing == NIL)
return; // no good
if (thing->o_magic != MAGIC)
return; // also no good
if (ob_class(thing)->c_sym != sSymThrough)
return; // last check
// If we make it to here, we're good to go
typedmess(thing, iMsg, iArgC, iArgV);
I'm trying to set up something simple like:
Symbol* existingObSym = gensym("existingOb");
existingObject = (Object*)existingObSym->s_thing;
typedmess( existingObject, gensym( "do_it" ), 0, 0L );
but I don't quite see how s_thing is used to bind the object properly. Please excuse my imprecise question - I just don't know exactly what to ask...
Thanks for any help.