Update of /cvsroot/pure-data/externals/tkwidgets/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29252/shared
Modified Files: tkwidgets.c tkwidgets.h Log Message:
- moved store_options() to tkwidgets_store_options() in tkwidgets.c and made [text] work with it there.
- made tkwidgets_store_options() ignore blank options
- minor cleanups
Index: tkwidgets.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tkwidgets.c 22 Nov 2007 00:37:59 -0000 1.5 --- tkwidgets.c 22 Nov 2007 02:53:22 -0000 1.6 *************** *** 33,36 **** --- 33,37 ---- }
+ /* -------------------- options handling ------------------------------------ */
void tkwidgets_query_options(t_symbol *receive_name, t_symbol *widget_id, *************** *** 43,46 **** --- 44,70 ---- }
+ /* this function queries the widget and sends the data to the store_callback */ + void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, + t_symbol *widget_id, int argc, char **argv) + { + // build list then send the whole shebang to store_callback + int i; + post("tkwidgets_store_options total options: %d", argc); + for(i = 0; i < argc; i++) + { + // TODO: only send if there is a value, not when blank + sys_vgui("set ::%s::ret [%s cget -%s]\n", + tcl_namespace->s_name, widget_id->s_name, argv[i]); + sys_vgui("if {[string length $::%s::ret] > 0} {\n", + tcl_namespace->s_name); + sys_vgui("lappend ::%s::store_list -%s ; lappend ::%s::store_list $::%s::ret}\n", + tcl_namespace->s_name, argv[i], + tcl_namespace->s_name, tcl_namespace->s_name); + } + sys_vgui("pd [concat %s store_callback $::%s::store_list \;]\n", + receive_name->s_name, tcl_namespace->s_name); + sys_vgui("unset ::%s::store_list \n", tcl_namespace->s_name); + } + void tkwidgets_restore_options(t_symbol *receive_name, t_symbol *widget_id, int argc, char** argv) *************** *** 55,58 **** --- 79,84 ---- }
+ /* -------------------- generate names for various elements ----------------- */ + t_symbol* tkwidgets_gen_tcl_namespace(t_object* x, t_symbol* widget_name) { *************** *** 125,138 **** }
- void tkwidgets_draw_handle() - { - // TODO draw resize handle when selected in editmode - } - - void tkwidgets_draw_resize_window() - { - // TODO draw the resize window while resizing - } - /* -------------------- inlets/outlets -------------------------------------- */
--- 151,154 ---- *************** *** 179,181 **** --- 195,207 ---- }
+ /* -------------------- gui elements for resizing --------------------------- */
+ void tkwidgets_draw_handle() + { + // TODO draw resize handle when selected in editmode + } + + void tkwidgets_draw_resize_window() + { + // TODO draw the resize window while resizing + }
Index: tkwidgets.h =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tkwidgets.h 22 Nov 2007 00:37:59 -0000 1.5 --- tkwidgets.h 22 Nov 2007 02:53:22 -0000 1.6 *************** *** 69,72 **** --- 69,80 ---- void tkwidgets_setcallbackname(void *x, char *widget_name);
+ /* handle options */ + void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, + t_symbol *widget_id, int argc, char **argv); + void tkwidgets_query_options(t_symbol *receive_name, t_symbol *widget_id, + int argc, char** argv); + + + /* generate ID and tag names for using in Tcl/Tk space */ t_symbol* tkwidgets_gen_tcl_namespace(t_object* x, t_symbol* widget_name); t_symbol* tkwidgets_gen_callback_name(t_symbol* tcl_namespace);