diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/tkwidgets.c | 9 | ||||
-rw-r--r-- | shared/tkwidgets.h | 17 |
2 files changed, 26 insertions, 0 deletions
diff --git a/shared/tkwidgets.c b/shared/tkwidgets.c index 6439842..587f2d8 100644 --- a/shared/tkwidgets.c +++ b/shared/tkwidgets.c @@ -32,6 +32,15 @@ t_symbol *canvas_getname(t_canvas *canvas) return gensym(buf); } + +void query_options(t_symbol *receive_name, char *widget_id, int argc, char** argv) +{ + int i; + for(i = 0; i < argc; i++) + sys_vgui("pd [concat %s query_callback %s [%s cget -%s] \\;]\n", + receive_name->s_name, argv[i], widget_id, argv[i]); +} + /* I think I'll probably have to follow Krzsztof and make structs to make this work tkwidgets_setcallbackname(void *x, char *widget_name) diff --git a/shared/tkwidgets.h b/shared/tkwidgets.h index 9365a7c..b7fdc00 100644 --- a/shared/tkwidgets.h +++ b/shared/tkwidgets.h @@ -37,6 +37,23 @@ #define TKW_HANDLE_WIDTH 15 #define TKW_HANDLE_INSET -2 +/* sketch for a common struct */ +typedef struct _tkwidgets +{ + t_symbol *canvas_id; /* the canvas that is showing this widget */ + t_symbol *receive_name; /* name to bind to, to receive callbacks */ + t_symbol *window_id; /* the window that contains the widget */ + t_symbol *widget_id; /* the core widget */ + t_symbol *all_tag; /* the tag for moving/deleting everything */ + int resizing; /* flag to tell when being resized */ + int selected; /* flag for when widget is selected */ +} t_tkwidgets; + + + +/* query a tk widget for the state of all its options */ +void query_options(t_symbol *receive_name, char *widget_id, int argc, char** argv); + /* this should be part of the Pd API */ t_symbol *canvas_getname(t_canvas *canvas); |