diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2007-11-24 00:33:42 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2007-11-24 00:33:42 +0000 |
commit | c00ea30f26399a1e94e923bcb5707434e745530a (patch) | |
tree | 9cbfa84436300ab3ad0fba0bd660797c4b4a5899 /shared/tkwidgets.c | |
parent | 91e2f3ffda622e180b88bb8ae0fa6ebbb42c8888 (diff) |
- 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
svn path=/trunk/externals/tkwidgets/; revision=9029
Diffstat (limited to 'shared/tkwidgets.c')
-rw-r--r-- | shared/tkwidgets.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/shared/tkwidgets.c b/shared/tkwidgets.c index eec524a..65dba8f 100644 --- a/shared/tkwidgets.c +++ b/shared/tkwidgets.c @@ -51,11 +51,11 @@ void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, int i; for(i = 0; i < argc; i++) { - sys_vgui("set ::%s::ret [%s cget -%s]\n", + 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::ret] > 0} {\n", + sys_vgui("if {[string length $::%s::tmp] > 0} {\n", tcl_namespace->s_name); - sys_vgui("lappend ::%s::list -%s; lappend ::%s::list $::%s::ret}\n", + 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); } @@ -64,8 +64,7 @@ void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, sys_vgui("unset ::%s::list \n", tcl_namespace->s_name); } -void tkwidgets_restore_options(t_symbol *receive_name, t_symbol *tcl_namespace, - t_symbol *widget_id, t_binbuf *options_binbuf) +void tkwidgets_restore_options(t_symbol *widget_id, t_binbuf *options_binbuf) { int length; char *options; @@ -74,6 +73,20 @@ void tkwidgets_restore_options(t_symbol *receive_name, t_symbol *tcl_namespace, sys_vgui("%s configure %s\n", widget_id->s_name, options); } +/* 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 ----------------- */ t_symbol* tkwidgets_gen_tcl_namespace(t_object* x, t_symbol* widget_name) |