Update of /cvsroot/pure-data/externals/tkwidgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv820
Modified Files: checkbutton.c text.c Log Message:
- 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
Index: checkbutton.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/checkbutton.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** checkbutton.c 23 Nov 2007 23:47:00 -0000 1.4 --- checkbutton.c 24 Nov 2007 00:33:42 -0000 1.5 *************** *** 116,120 **** static void checkbutton_drawme(t_checkbutton *x, t_glist *glist) { - set_tkwidgets_ids(x,glist_getcanvas(glist)); sys_vgui("destroy %s\n", x->widget_id->s_name); /* just in case it exists */ --- 116,119 ---- *************** *** 129,138 **** x->widget_id->s_name, x->window_tag->s_name, x->all_tag->s_name); }
! static void checkbutton_erase(t_checkbutton* x, t_glist* glist) { - set_tkwidgets_ids(x, glist_getcanvas(glist)); sys_vgui("destroy %s\n", x->widget_id->s_name); sys_vgui("%s delete %s\n", x->canvas_id->s_name, x->all_tag->s_name); --- 128,138 ---- x->widget_id->s_name, x->window_tag->s_name, x->all_tag->s_name); + tkwidgets_bind_key_events(x->canvas_id, x->widget_id); + tkwidgets_bind_mouse_events(x->canvas_id, x->widget_id); }
! static void checkbutton_erase(t_checkbutton* x) { sys_vgui("destroy %s\n", x->widget_id->s_name); sys_vgui("%s delete %s\n", x->canvas_id->s_name, x->all_tag->s_name); *************** *** 186,191 **** if (glist_isvisible(glist)) { ! 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); --- 186,191 ---- if (glist_isvisible(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); *************** *** 205,209 **** checkbutton_drawme(s, glist); else ! checkbutton_erase(s, glist); }
--- 205,209 ---- checkbutton_drawme(s, glist); else ! checkbutton_erase(s); }
Index: text.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** text.c 23 Nov 2007 23:47:00 -0000 1.11 --- text.c 24 Nov 2007 00:33:42 -0000 1.12 *************** *** 28,31 **** --- 28,32 ---- /* TODO: window name "handle1376fc00" already exists in parent */ /* TODO: figure out window vs. text width/height */ + /* TODO: handle bg color on select/deselect */
*************** *** 194,199 **** x->frame_id->s_name, x->window_tag->s_name, x->all_tag->s_name, x->width, x->height); ! tkwidgets_restore_options(x->receive_name, x->tcl_namespace, ! x->widget_id, x->options_binbuf); }
--- 195,199 ---- x->frame_id->s_name, x->window_tag->s_name, x->all_tag->s_name, x->width, x->height); ! tkwidgets_restore_options(x->widget_id, x->options_binbuf); }
*************** *** 229,233 **** if (glist_isvisible(glist)) { ! 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); --- 229,233 ---- if (glist_isvisible(glist)) { ! // set_tkwidgets_ids(x,glist_getcanvas(glist)); /* TODO is this needed here? */ 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); *************** *** 472,476 **** }
! static void textwidget_option(t_textwidget *x, t_symbol *s, int argc, t_atom *argv) { if(s != &s_list) --- 472,478 ---- }
! /* this function uses the selector as the Tk option and applies the whole ! * message directly to the Tk widget itself using Tk's "configure" */ ! static void textwidget_set_option(t_textwidget *x, t_symbol *s, int argc, t_atom *argv) { if(s != &s_list) *************** *** 484,488 **** binbuf_free(argument_binbuf); argument_buffer[buffer_length] = 0; - post("argument_buffer: %s", argument_buffer); sys_vgui("%s configure -%s {%s} \n", x->widget_id->s_name, s->s_name, argument_buffer); --- 486,489 ---- *************** *** 493,496 **** --- 494,504 ---- }
+ static void textwidget_options(t_textwidget *x) + { + tkwidgets_list_options(x->x_status_outlet, + sizeof(textwidget_tk_options)/sizeof(char *), + (char **)&textwidget_tk_options); + } + static void query_scrollbars(t_textwidget *x) { *************** *** 666,670 ****
x->x_glist = canvas_getcurrent(); ! set_tkwidgets_ids(x, x->x_glist); x->iolets_tag = tkwidgets_gen_iolets_tag((t_object*)x); x->all_tag = tkwidgets_gen_all_tag((t_object*)x); --- 674,678 ----
x->x_glist = canvas_getcurrent(); ! // set_tkwidgets_ids(x, x->x_glist); /* TODO: is this needed here? */ x->iolets_tag = tkwidgets_gen_iolets_tag((t_object*)x); x->all_tag = tkwidgets_gen_all_tag((t_object*)x); *************** *** 682,686 **** class_addbang(textwidget_class, (t_method)textwidget_bang_output); ! class_addanything(textwidget_class, (t_method)textwidget_option);
class_addmethod(textwidget_class, (t_method)textwidget_append, --- 690,694 ---- class_addbang(textwidget_class, (t_method)textwidget_bang_output); ! class_addanything(textwidget_class, (t_method)textwidget_set_option);
class_addmethod(textwidget_class, (t_method)textwidget_append, *************** *** 690,693 **** --- 698,703 ---- class_addmethod(textwidget_class, (t_method)textwidget_key, gensym("key"), A_GIMME, 0); + class_addmethod(textwidget_class, (t_method)textwidget_options, + gensym("options"), 0); class_addmethod(textwidget_class, (t_method)textwidget_query, gensym("query"), A_DEFSYMBOL, 0); *************** *** 698,701 **** --- 708,712 ---- class_addmethod(textwidget_class, (t_method)textwidget_size, gensym("size"), A_DEFFLOAT, A_DEFFLOAT, 0); + /* callbacks */ class_addmethod(textwidget_class, (t_method)textwidget_store_callback,