Hey Frank,
I did not think of using a popup menu for file selection. (partically because I had in mind to make a version of Yves playlist using a listbox and scrollbar, so I did not think of the possibility of using a popup.) so I suppose a switch to turn on returning symbols or returning index values would be best. That way when using the menu to select things like gem window messages you could use selects and not have to fill an [index] object with symbols.
Is [index] the best way to compare symbols?
Thanks for the feedback.
Ben
Frank Barknecht wrote:
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