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

Frank Barknecht fbar at footils.org
Thu Feb 19 08:13:28 CET 2004


Hallo,
B. Bogart hat gesagt: // B. Bogart wrote:

> 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 think this would be nicer. One use, the popup could have, is
selection of files to play somehow. Then you w/could store the
filenames inside the popup and on selection play a new file. With an
index value, you'd need another storage for the filenames, like pool
or so.

ciao
-- 
 Frank Barknecht                               _ ______footils.org__




More information about the Pd-dev mailing list