diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2007-11-24 05:57:15 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2007-11-24 05:57:15 +0000 |
commit | b1ffed4b75b42b7e86899b4e8859f3b543418394 (patch) | |
tree | ed75215a72de21fab9011089132de99791db7014 /shared/tkwidgets.c | |
parent | 380823b3bcbf0f5112308d1975f51e06e836b212 (diff) |
- made selection color change restore previous background color
- moved scrollbar handling to tkwidgets.c
svn path=/trunk/externals/tkwidgets/; revision=9032
Diffstat (limited to 'shared/tkwidgets.c')
-rw-r--r-- | shared/tkwidgets.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/shared/tkwidgets.c b/shared/tkwidgets.c index d58f643..a5d1b8c 100644 --- a/shared/tkwidgets.c +++ b/shared/tkwidgets.c @@ -24,14 +24,6 @@ #include <stdio.h> #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 ------------------------------------ */ void tkwidgets_query_options(t_symbol *receive_name, t_symbol *widget_id, @@ -207,6 +199,24 @@ void tkwidgets_erase_iolets(t_symbol* canvas_id, t_symbol* iolets_tag) sys_vgui("%s delete %s\n", canvas_id->s_name, iolets_tag->s_name); } +/* -------------------- 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 ----------------------- */ |