Update of /cvsroot/pure-data/externals/tkwidgets/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv820/shared
Modified Files: tkwidgets.c tkwidgets.h Log Message:
- created tkwidgets_list_options() to query which Tk options are supported
- removed set_tk_widgets_ids() from places where it wasn't need AFAIK
- minor renames and cleanups
Index: tkwidgets.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tkwidgets.c 23 Nov 2007 23:47:00 -0000 1.9 --- tkwidgets.c 24 Nov 2007 00:33:42 -0000 1.10 *************** *** 52,60 **** for(i = 0; i < argc; i++) { ! 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::list -%s; lappend ::%s::list $::%s::ret}\n", tcl_namespace->s_name, argv[i], tcl_namespace->s_name, tcl_namespace->s_name); --- 52,60 ---- for(i = 0; i < argc; i++) { ! sys_vgui("set ::%s::tmp [%s cget -%s]\n", tcl_namespace->s_name, widget_id->s_name, argv[i]); ! sys_vgui("if {[string length $::%s::tmp] > 0} {\n", tcl_namespace->s_name); ! sys_vgui("lappend ::%s::list -%s; lappend ::%s::list $::%s::tmp}\n", tcl_namespace->s_name, argv[i], tcl_namespace->s_name, tcl_namespace->s_name); *************** *** 65,70 **** }
! void tkwidgets_restore_options(t_symbol *receive_name, t_symbol *tcl_namespace, ! t_symbol *widget_id, t_binbuf *options_binbuf) { int length; --- 65,69 ---- }
! void tkwidgets_restore_options(t_symbol *widget_id, t_binbuf *options_binbuf) { int length; *************** *** 75,78 **** --- 74,91 ---- }
+ /* output a list of available options for this widget */ + void tkwidgets_list_options(t_outlet *status_outlet, int argc, char** argv) + { + int i; + t_binbuf *bb = binbuf_new(); + for(i = 0; i < argc; ++i) + { + binbuf_addv(bb, "s", gensym(argv[i])); + } + outlet_anything(status_outlet, gensym("options"), + binbuf_getnatom(bb), binbuf_getvec(bb)); + } + + /* -------------------- generate names for various elements ----------------- */
Index: tkwidgets.h =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tkwidgets.h 23 Nov 2007 22:44:03 -0000 1.8 --- tkwidgets.h 24 Nov 2007 00:33:42 -0000 1.9 *************** *** 72,80 **** void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, t_symbol *widget_id, int argc, char **argv); ! void tkwidgets_restore_options(t_symbol *receive_name, t_symbol *tcl_namespace, ! t_symbol *widget_id, t_binbuf *options_binbuf); 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 */ --- 72,79 ---- void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, t_symbol *widget_id, int argc, char **argv); ! void tkwidgets_restore_options(t_symbol *widget_id, t_binbuf *options_binbuf); void tkwidgets_query_options(t_symbol *receive_name, t_symbol *widget_id, int argc, char** argv); ! void tkwidgets_list_options(t_outlet *status_outlet, int argc, char** argv);
/* generate ID and tag names for using in Tcl/Tk space */