Update of /cvsroot/pure-data/externals/tkwidgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13308/tkwidgets
Modified Files: text-test.pd text.c Log Message:
- first working sketch of having a shared dylib for a libdir, I moved query_options() to the dylib, and it works! :D (on Mac OS X, at least)
- minor cleanups in text.c
- first test of saving options to the file, it writes data, but there are bugs
Index: text-test.pd =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text-test.pd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** text-test.pd 14 Nov 2007 07:49:26 -0000 1.3 --- text-test.pd 15 Nov 2007 17:27:03 -0000 1.4 *************** *** 4,8 **** #X obj 48 470 text 130 60 0; #X msg 130 30 size 400 200; ! #X obj 310 11 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X msg 655 333; --- 4,8 ---- #X obj 48 470 text 130 60 0; #X msg 130 30 size 400 200; ! #X obj 310 11 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 655 333; *************** *** 25,28 **** --- 25,32 ---- #X msg 309 31 scrollbars $1; #X msg 85 367 query size; + #X msg 342 369; + #X obj 310 335 prepend set; + #X msg 250 41 bang; + #X connect 0 0 22 0; #X connect 0 1 5 0; #X connect 1 0 0 0; *************** *** 44,45 **** --- 48,51 ---- #X connect 19 0 0 0; #X connect 20 0 2 0; + #X connect 22 0 21 0; + #X connect 23 0 0 0;
Index: text.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** text.c 14 Nov 2007 07:49:26 -0000 1.4 --- text.c 15 Nov 2007 17:27:03 -0000 1.5 *************** *** 161,164 **** --- 161,165 ---- for(i = 0; i < argc; i++) { + // TODO: only send if there is a value, not when blank sys_vgui("lappend ::%s::store_list -%s \n", x->tcl_namespace, textwidget_tk_options[i]); *************** *** 177,188 **** }
- static void query_options(t_textwidget *x, int argc, char** argv) - { - int i; - for(i = 0; i < argc; i++) - sys_vgui("pd [concat %s query_callback %s [%s cget -%s] \;]\n", - x->receive_name->s_name, argv[i], x->text_id, argv[i]); - } - static void set_tk_widget_ids(t_textwidget *x, t_canvas *canvas) { --- 178,181 ---- *************** *** 322,326 **** { DEBUG(post("create_widget");); - /* I guess this is for fine-tuning of the rect size based on width and height? */
sys_vgui("namespace eval text%lx {} \n", x); --- 315,318 ---- *************** *** 330,338 **** sys_vgui("frame %s \n", x->frame_id); sys_vgui("text %s -border 1 \ ! -highlightthickness 1 -relief sunken -bg "%s" -fg "%s" \ ! -yscrollcommand {%s set} \n", ! x->text_id, ! DEFAULT_COLOR, "black", ! x->scrollbar_id); sys_vgui("scrollbar %s -command {%s yview}\n", x->scrollbar_id, x->text_id); --- 322,327 ---- sys_vgui("frame %s \n", x->frame_id); sys_vgui("text %s -border 1 \ ! -highlightthickness 1 -relief sunken -bg "%s" -yscrollcommand {%s set} \n", ! x->text_id, DEFAULT_COLOR, x->scrollbar_id); sys_vgui("scrollbar %s -command {%s yview}\n", x->scrollbar_id, x->text_id); *************** *** 642,649 **** t_textwidget *x = (t_textwidget *)z;
! binbuf_addv(b, "ssiisiii;", &s__X, gensym("obj"), x->x_obj.te_xpix, x->x_obj.te_ypix, atom_getsymbol(binbuf_getvec(x->x_obj.te_binbuf)), x->size_x, x->size_y, x->x_have_scrollbars); }
--- 631,640 ---- t_textwidget *x = (t_textwidget *)z;
! binbuf_addv(b, "ssiisiii", &s__X, gensym("obj"), x->x_obj.te_xpix, x->x_obj.te_ypix, atom_getsymbol(binbuf_getvec(x->x_obj.te_binbuf)), x->size_x, x->size_y, x->x_have_scrollbars); + binbuf_addbinbuf(b, x->options_binbuf); + binbuf_addv(b, ";"); }
*************** *** 663,666 **** --- 654,658 ---- sys_vgui("%s configure -%s {%s} \n", x->text_id, s->s_name, argument_buffer); + store_options(x); } } *************** *** 688,692 **** if(s == &s_) { ! query_options(x, sizeof(textwidget_tk_options)/sizeof(char *), textwidget_tk_options); query_scrollbars(x); query_size(x); --- 680,685 ---- if(s == &s_) { ! query_options(x->receive_name, x->text_id, ! sizeof(textwidget_tk_options)/sizeof(char *), textwidget_tk_options); query_scrollbars(x); query_size(x); *************** *** 697,701 **** query_size(x); else ! query_options(x, 1, &(s->s_name)); }
--- 690,694 ---- query_size(x); else ! query_options(x->receive_name, x->text_id, 1, &(s->s_name)); }