Update of /cvsroot/pure-data/externals/tkwidgets/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16532/shared
Modified Files: tkwidgets.c tkwidgets.h Log Message:
- made selection color change restore previous background color
- moved scrollbar handling to tkwidgets.c
Index: tkwidgets.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tkwidgets.c 24 Nov 2007 04:07:23 -0000 1.11 --- tkwidgets.c 24 Nov 2007 05:57:15 -0000 1.12 *************** *** 25,36 **** #include <string.h>
- /* this should be part of the Pd API */ - t_symbol *canvas_getname(t_canvas *canvas) - { - char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, ".x%lx", (unsigned long)glist_getcanvas(canvas)); - return gensym(buf); - } - /* -------------------- options handling ------------------------------------ */
--- 25,28 ---- *************** *** 208,211 **** --- 200,221 ---- }
+ /* -------------------- scrollbars ------------------------------------------ */ + + void tkwidgets_draw_y_scrollbar(t_symbol *widget_id, t_symbol *scrollbar_id) + { + sys_vgui("scrollbar %s -orient vertical -command {%s yview}\n", + scrollbar_id->s_name, widget_id->s_name); + sys_vgui("pack %s -side right -fill y -before %s \n", + scrollbar_id->s_name, widget_id->s_name); + sys_vgui("%s configure -yscrollcommand {%s set}\n", + widget_id->s_name, scrollbar_id->s_name); + } + + void tkwidgets_erase_y_scrollbar(t_symbol *widget_id, t_symbol *scrollbar_id) + { + sys_vgui("%s configure -yscrollcommand {}\n", widget_id->s_name); + sys_vgui("pack forget %s \n", scrollbar_id->s_name); + sys_vgui("destroy %s \n", scrollbar_id->s_name); + }
/* -------------------- bind to keys and mouse events ----------------------- */
Index: tkwidgets.h =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tkwidgets.h 24 Nov 2007 04:07:23 -0000 1.10 --- tkwidgets.h 24 Nov 2007 05:57:15 -0000 1.11 *************** *** 38,41 **** --- 38,43 ---- #define TOTAL_OUTLETS 2
+ #define TKW_SELECTION_COLOR "#bdbddd" + /* size and offset for the resizing handle */ #define TKW_HANDLE_HEIGHT 15 *************** *** 61,76 **** } t_tkwidgets;
- /* query a tk widget for the state of all its options */ - void tkwidgets_query_options(t_symbol* receive_name, t_symbol *widget_id, - int argc, char** argv); - /* initialize things on new widget */ - void tkwidgets_new(t_tkwidgets* tkw); - - - /* this should be part of the Pd API */ - t_symbol* canvas_getname(t_canvas *canvas); - - void tkwidgets_setcallbackname(void *x, char *widget_name); - /* handle options */ void tkwidgets_store_options(t_symbol *receive_name, t_symbol *tcl_namespace, --- 63,66 ---- *************** *** 99,106 **** --- 89,102 ---- int width, int height); void tkwidgets_erase_iolets(t_symbol* canvas_id, t_symbol* iolets_tag); + void tkwidgets_draw_y_scrollbar(t_symbol *widget_id, t_symbol *scrollbar_id); + void tkwidgets_erase_y_scrollbar(t_symbol *widget_id, t_symbol *scrollbar_id);
void tkwidgets_draw_handle(); // TODO draw resize handle when selected in editmode void tkwidgets_draw_resize_window(); // TODO draw the resize window while resizing
+ /* selection */ + + + /* bind this widget to Cmd/Ctrl keys and mouse events to support things like * then standard keys and right-click to bring up the Properties/Open/Help