Update of /cvsroot/pure-data/externals/tkwidgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17234
Modified Files: checkbutton-help.pd checkbutton.c Log Message: added float and bang methods to checkbutton, the float method needs some work on the logic
Index: checkbutton.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/checkbutton.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** checkbutton.c 24 Nov 2007 07:00:45 -0000 1.8 --- checkbutton.c 24 Nov 2007 07:30:33 -0000 1.9 *************** *** 23,26 **** --- 23,27 ---- /* TODO rectify char and pixel widths/heights ug */ /* TODO bind to <Configure> so that things are redrawn when the text changes */ + /* TODO add float method to set state based on == 0 and everything else */
#include "shared/tkwidgets.h" *************** *** 275,283 **** }
! /* Pass the contents of the text widget onto the textwidget_output_callback * fuction above */ static void checkbutton_bang_output(t_checkbutton* x) { ! sys_vgui("%s invoke", x->widget_id->s_name); }
--- 276,294 ---- }
! /* Pass the contents of the text widget onto the checkbutton_output_callback * fuction above */ static void checkbutton_bang_output(t_checkbutton* x) { ! sys_vgui("%s invoke\n", x->widget_id->s_name); ! } ! ! /* Pass the contents of the text widget onto the checkbutton_output_callback ! * fuction above */ ! 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); }
*************** *** 407,410 **** --- 418,423 ---- /* methods for atoms */ class_addanything(checkbutton_class, (t_method)checkbutton_set_option); + class_addbang(checkbutton_class, (t_method)checkbutton_bang_output); + class_addfloat(checkbutton_class, (t_method)checkbutton_float_output);
/* methods for pd space */
Index: checkbutton-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/checkbutton-help.pd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** checkbutton-help.pd 24 Nov 2007 07:00:45 -0000 1.3 --- checkbutton-help.pd 24 Nov 2007 07:30:33 -0000 1.4 *************** *** 17,20 **** --- 17,27 ---- ; #X msg 141 21 onvalue 5; + #X msg 347 116 fg blue; + #X msg 349 138 bg pink; + #X msg 367 188 anchor w; + #X msg 116 117 bang; + #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; *************** *** 28,29 **** --- 35,42 ---- #X connect 11 0 0 0; #X connect 13 0 0 0; + #X connect 14 0 0 0; + #X connect 15 0 0 0; + #X connect 16 0 0 0; + #X connect 17 0 0 0; + #X connect 18 0 0 0; + #X connect 19 0 0 0;