[L2Ork-dev] external dialog API (was: updating cyclone)

Jonathan Wilkes jancsika at yahoo.com
Wed Apr 19 19:04:00 UTC 2017


Also-- I'll go ahead and describe the external dialog interface.
gui_vmess("gui_external_dialog", "ss", gfx_tag, class_name);gui_start_array();gui_s("type");gui_s("key");gui_i/s/f("value");...gui_end_array();gui_end_vmess();
This basically creates an array of "triples" that define the type of input, name of the input, and value. 
On the GUI side, each input is drawn in the same order as above.  When the "Ok" button is clicked, 
the values are sent back to Pd in the same order as above.
The basic input types are: "int", "float", "symbol", "toggle", and "color".

There's one special input type called "enum" for creating dropdown lists:gui_s("enum"); gui_s("style"); gui_s("Big");gui_s("enum"); gui_s("style"); gui_s("Little");gui_s("enum"); gui_s("style"); gui_s("Blank");gui_s("enum_index"); gui_s("style"); gui_i(2);
So this would create a dropdown list with options "Big", "Little", and "Blank" 
displayed. Since the "enum_index" is 2, "Blank" would be the default selection.When the "Ok" button is clicked, the index of the selected value is sent back 
to Pd. (Hence the name "enum").  It's clunky, but it gets the job done.
Anyway, this API reduces the ~800 lines of ad hoc code for each external dialog down 
to ~200 shared code for all external dialogs.
-Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://disis.music.vt.edu/pipermail/l2ork-dev/attachments/20170419/40b5fe81/attachment.html>


More information about the L2Ork-dev mailing list