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

guenter geiger geiger at xdv.org
Thu Feb 19 20:10:12 CET 2004


On Wed, 18 Feb 2004, 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);

For the button widget, a callback gets defined (with the sys_vgui()
command). This callback is passed as an argument to the widget
creation with "button".

This means, everytime the button is pressed,
"pd [concat button%p b \\;]" is executed, which sends "b" to a
receiver symbol.

All a bit complicated :)

Guenter










>
> 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
>
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev
>





More information about the Pd-dev mailing list