Update of /cvsroot/pure-data/externals/tkwidgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29252
Modified Files: text-test.pd text.c Log Message:
- moved store_options() to tkwidgets_store_options() in tkwidgets.c and made [text] work with it there.
- made tkwidgets_store_options() ignore blank options
- minor cleanups
Index: text-test.pd =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text-test.pd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** text-test.pd 15 Nov 2007 17:27:03 -0000 1.4 --- text-test.pd 22 Nov 2007 02:53:22 -0000 1.5 *************** *** 1,3 **** ! #N canvas 171 184 721 672 10; #X obj 256 77 text 400 200 1; #X msg 47 29 size 100 100; --- 1,3 ---- ! #N canvas 137 196 721 672 10; #X obj 256 77 text 400 200 1; #X msg 47 29 size 100 100;
Index: text.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** text.c 22 Nov 2007 00:37:59 -0000 1.7 --- text.c 22 Nov 2007 02:53:22 -0000 1.8 *************** *** 30,33 **** --- 30,34 ---- /* TODO: remove glist from _erase() args */ /* TODO: window name "handle1376fc00" already exists in parent */ + /* TODO: figure out window vs. text width/height */
*************** *** 136,164 **** /* -------------------- widget helper functions ----------------------------- */
- static void store_options(t_textwidget *x) - { - // build list then send the whole shebang to store_callback - int i; - int argc = sizeof(textwidget_tk_options)/sizeof(char *); - post("total options: %d", argc); - 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->s_name, textwidget_tk_options[i]); - sys_vgui("lappend ::%s::store_list [%s cget -%s] \n", - x->tcl_namespace->s_name, x->widget_id, textwidget_tk_options[i]); - post("option %d: %s", i, textwidget_tk_options[i]); - } - sys_vgui("pd [concat %s store_callback $::%s::store_list \;]\n", - x->receive_name->s_name, x->tcl_namespace->s_name); - sys_vgui("unset ::%s::store_list \n", x->tcl_namespace->s_name); - } - - static void restore_options(t_textwidget *x) - { - // TODO restore options from x->options_binbuf - } - static void set_tkwidgets_ids(t_textwidget *x, t_canvas *canvas) { --- 137,140 ---- *************** *** 308,312 **** set_tkwidgets_ids(x,glist_getcanvas(glist)); sys_vgui("%s move %s %d %d\n", x->canvas_id->s_name, x->all_tag->s_name, dx, dy); ! sys_vgui("%s move RSZ %d %d\n", x->canvas_id->s_name, dx, dy); canvas_fixlinesfor(glist_getcanvas(glist), (t_text*) x); } --- 284,288 ---- set_tkwidgets_ids(x,glist_getcanvas(glist)); sys_vgui("%s move %s %d %d\n", x->canvas_id->s_name, x->all_tag->s_name, dx, dy); ! sys_vgui("%s move RESIZE %d %d\n", x->canvas_id->s_name, dx, dy); canvas_fixlinesfor(glist_getcanvas(glist), (t_text*) x); } *************** *** 354,358 **** /* sys_vgui("%s create line %d %d %d %d -fill black -tags RESIZE_LINES\n", */ /* x->handle_id->s_name, handle_x2, handle_y1, handle_x1, handle_y2); */ ! sys_vgui("%s create window %d %d -anchor nw -width %d -height %d -window %s -tags RSZ\n", x->canvas_id->s_name, handle_x1, handle_y1, TKW_HANDLE_WIDTH, TKW_HANDLE_HEIGHT, --- 330,334 ---- /* sys_vgui("%s create line %d %d %d %d -fill black -tags RESIZE_LINES\n", */ /* x->handle_id->s_name, handle_x2, handle_y1, handle_x1, handle_y2); */ ! sys_vgui("%s create window %d %d -anchor nw -width %d -height %d -window %s -tags RESIZE\n", x->canvas_id->s_name, handle_x1, handle_y1, TKW_HANDLE_WIDTH, TKW_HANDLE_HEIGHT, *************** *** 563,567 **** sys_vgui("%s configure -%s {%s} \n", x->widget_id->s_name, s->s_name, argument_buffer); ! store_options(x); } } --- 539,545 ---- sys_vgui("%s configure -%s {%s} \n", x->widget_id->s_name, s->s_name, argument_buffer); ! tkwidgets_store_options(x->receive_name, x->tcl_namespace, x->widget_id, ! sizeof(textwidget_tk_options)/sizeof(char *), ! &textwidget_tk_options); } } *************** *** 647,651 **** else { ! post("textwidget_query_callback %s %d", s->s_name, argc); } } --- 625,629 ---- else { ! post("ERROR: textwidget_query_callback %s %d", s->s_name, argc); } } *************** *** 693,697 **** x->canvas_id->s_name, x->window_tag->s_name, x->width, x->height); ! sys_vgui("%s move RSZ %d %d\n", x->canvas_id->s_name, dx, dy); canvas_fixlinesfor(x->x_glist, (t_text *)x); --- 671,675 ---- x->canvas_id->s_name, x->window_tag->s_name, x->width, x->height); ! sys_vgui("%s move RESIZE %d %d\n", x->canvas_id->s_name, dx, dy); canvas_fixlinesfor(x->x_glist, (t_text *)x); *************** *** 732,736 **** { binbuf_add(x->options_binbuf, argc - 3, argv + 3); ! restore_options(x); } } --- 710,714 ---- { binbuf_add(x->options_binbuf, argc - 3, argv + 3); ! //TODO tkwidgets_restore_options(x->receive_name, x->widget_id); } }