Update of /cvsroot/pure-data/externals/tkwidgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6263
Modified Files: checkbutton-help.pd checkbutton.c Log Message: added [set( and [options( methods, but still have to figure out how to deal with 'offvalue/onvalue' properly
Index: checkbutton.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/checkbutton.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** checkbutton.c 24 Nov 2007 07:30:33 -0000 1.9 --- checkbutton.c 24 Nov 2007 17:39:44 -0000 1.10 *************** *** 106,109 **** --- 106,110 ----
static void checkbutton_query_callback(t_checkbutton *x, t_symbol *s, int argc, t_atom *argv); + static void checkbutton_set(t_checkbutton* x, t_float f);
/* -------------------- widget helper functions------------------------------ */ *************** *** 287,293 **** static void checkbutton_float_output(t_checkbutton* x, t_float f) { ! /* TODO figure out which matches make sense, in terms of offvalue/onvalue */ ! sys_vgui("if {%g != 0} {%s select} else {%s deselect}\n", ! f, x->widget_id->s_name, x->widget_id->s_name, x->widget_id->s_name); outlet_float(x->x_data_outlet, f); } --- 288,292 ---- static void checkbutton_float_output(t_checkbutton* x, t_float f) { ! checkbutton_set(x, f); outlet_float(x->x_data_outlet, f); } *************** *** 295,298 **** --- 294,311 ---- /* --------------------------- methods for pd space ------------------------- */
+ static void checkbutton_options(t_checkbutton *x) + { + tkwidgets_list_options(x->x_status_outlet, + sizeof(checkbutton_tk_options)/sizeof(char *), + (char **)&checkbutton_tk_options); + } + + static void checkbutton_set(t_checkbutton* x, t_float f) + { + /* TODO figure out which matches make sense, in terms of offvalue/onvalue */ + sys_vgui("if {%g != 0} {%s select} else {%s deselect}\n", + f, x->widget_id->s_name, x->widget_id->s_name, x->widget_id->s_name); + } + static void checkbutton_size(t_checkbutton *x, t_float width, t_float height) { *************** *** 422,427 **** --- 435,444 ----
/* methods for pd space */ + class_addmethod(checkbutton_class, (t_method)checkbutton_options, + gensym("options"), 0); class_addmethod(checkbutton_class, (t_method)checkbutton_query, gensym("query"), A_DEFSYMBOL, 0); + class_addmethod(checkbutton_class, (t_method)checkbutton_set, + gensym("set"), A_DEFFLOAT, 0); class_addmethod(checkbutton_class, (t_method)checkbutton_size, gensym("size"), A_DEFFLOAT, A_DEFFLOAT, 0);
Index: checkbutton-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/checkbutton-help.pd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** checkbutton-help.pd 24 Nov 2007 07:30:33 -0000 1.4 --- checkbutton-help.pd 24 Nov 2007 17:39:44 -0000 1.5 *************** *** 4,8 **** #X obj 263 255 print QUERY; #X msg 24 80 query size; - #X msg 172 78 size 100 100; #X obj 144 168 cnv 15 160 80 empty empty empty 20 12 0 14 -233017 -66577 0; --- 4,7 ---- *************** *** 10,14 **** #X msg 204 144 cursor gumby; #X obj 155 262 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 ! 5; #X msg 192 121 text gumby; #X msg 159 53 size 90 20; --- 9,13 ---- #X msg 204 144 cursor gumby; #X obj 155 262 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 ! 1; #X msg 192 121 text gumby; #X msg 159 53 size 90 20; *************** *** 23,37 **** #X obj 127 94 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; ! #X msg 53 19 offvalue 3; ! #X connect 0 0 6 0; ! #X connect 0 0 8 0; #X connect 0 1 2 0; #X connect 1 0 0 0; #X connect 3 0 0 0; ! #X connect 4 0 0 0; ! #X connect 7 0 0 0; #X connect 9 0 0 0; #X connect 10 0 0 0; ! #X connect 11 0 0 0; #X connect 13 0 0 0; #X connect 14 0 0 0; --- 22,38 ---- #X obj 127 94 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; ! #X msg 125 3 offvalue 3; ! #X msg 172 78 options; ! #X msg 29 140 set 5; ! #X connect 0 0 5 0; ! #X connect 0 0 7 0; #X connect 0 1 2 0; #X connect 1 0 0 0; #X connect 3 0 0 0; ! #X connect 6 0 0 0; ! #X connect 8 0 0 0; #X connect 9 0 0 0; #X connect 10 0 0 0; ! #X connect 12 0 0 0; #X connect 13 0 0 0; #X connect 14 0 0 0; *************** *** 41,42 **** --- 42,44 ---- #X connect 18 0 0 0; #X connect 19 0 0 0; + #X connect 20 0 0 0;