[PD-dev] How to send data from pd-gui to pd??

B. Bogart ben at ekran.org
Thu Feb 19 01:40:06 CET 2004


Hey all,

I'm almost finished [popup], with a couple bugs and the biggest issue 
being that I can't figure out how to pass data from the tk widget back 
to pd.. (telling it what menu item was selected!) in GGEE button.c seems 
to do the magic here, could someone explain whats really going on?

    sprintf(buf,"button%p",x);
    x->x_sym = gensym(buf);
    pd_bind(&x->x_obj.ob_pd, x->x_sym);

    sys_vgui("proc button_cb%x {} {\n pd [concat button%p b \\;]\n 
}\n",x,x);

I was originally going to get the external to ouput the symbol that is 
the same as the menu label selected, but recently working a little more 
with symbols in PD it seems to be quite a anoyance to test if symbols 
match (I've been using index from zexy) so I'm now thinking the external 
will just output the index value of the message. I think it would be 
handy at times to be able to use the output of the popup as a message 
directly to some other object, without having to test with an array of 
selects. Anyone have an opinion on the matter?

I'm hoping to get started writing the [text] external soon for nice text 
editing...

Thanks
Ben





More information about the Pd-dev mailing list