aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-09-14 04:50:26 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-09-14 04:50:26 +0000
commitfc2c93fe82978abda4b3a5f0d349ac298a42767d (patch)
treea718604cf12e72ba0f2329d23a9923ee468c8b0f
parentb84ccf92049f602e6a18e4d4677454bdc9752f2f (diff)
fixed to work on Pd < 0.43
svn path=/trunk/externals/tkwidgets/; revision=14136
-rw-r--r--text.c13
-rw-r--r--tkwidgets.c10
2 files changed, 12 insertions, 11 deletions
diff --git a/text.c b/text.c
index 96ca9bb..610d574 100644
--- a/text.c
+++ b/text.c
@@ -37,7 +37,8 @@
#define TEXT_MIN_WIDTH 40
#define TEXT_MIN_HEIGHT 20
-#define DEBUG(x) x
+#define DEBUG(x)
+//#define DEBUG(x) x
static t_class *textwidget_class;
static t_widgetbehavior textwidget_widgetbehavior;
@@ -189,7 +190,7 @@ static void create_widget(t_textwidget *x)
tkwidgets_bind_key_events(x->canvas_id, x->widget_id);
tkwidgets_bind_mouse_events(x->canvas_id, x->widget_id);
/* bind to KeyRelease events to send out right outlet one key at a time */
- sys_vgui("bind %s <KeyRelease> {+pdsend \"%s keyup %%N \"} \n",
+ sys_vgui("bind %s <KeyRelease> {+pd %s keyup %%N \\;} \n",
x->widget_id->s_name, x->receive_name->s_name);
/* override the standard Pd bindings for these since they cause trouble */
#ifdef __APPLE__
@@ -316,11 +317,11 @@ static void textwidget_activate(t_gobj *z, t_glist *glist, int state)
TKW_HANDLE_WIDTH, TKW_HANDLE_HEIGHT,
x->handle_id->s_name, x->all_tag->s_name);
sys_vgui("raise %s\n", x->handle_id->s_name);
- sys_vgui("bind %s <Button> {pdsend \"%s resize_click 1 \"}",
+ sys_vgui("bind %s <Button> {pd [concat %s resize_click 1 \\;]}\n",
x->handle_id->s_name, x->receive_name->s_name);
- sys_vgui("bind %s <ButtonRelease> {pdsend \"%s resize_click 0 \"}",
+ sys_vgui("bind %s <ButtonRelease> {pd [concat %s resize_click 0 \\;]}\n",
x->handle_id->s_name, x->receive_name->s_name);
- sys_vgui("bind %s <Motion> {pdsend \"%s resize_motion %%x %%y \"}",
+ sys_vgui("bind %s <Motion> {pd [concat %s resize_motion %%x %%y \\;]}\n",
x->handle_id->s_name, x->receive_name->s_name);
}
}
@@ -399,7 +400,7 @@ static void textwidget_set_option(t_textwidget *x, t_symbol *s, int argc, t_atom
static void textwidget_bang_output(t_textwidget* x)
{
/* With "," and ";" escaping thanks to JMZ */
- sys_vgui("pdsend [concat %s output [string map {\",\" \"\\\\,\" \";\" \"\\\\;\"} \
+ sys_vgui("pd [concat %s output [string map {\",\" \"\\\\,\" \";\" \"\\\\;\"} \
[%s get 0.0 end]] \\;]\n",
x->receive_name->s_name, x->widget_id->s_name);
}
diff --git a/tkwidgets.c b/tkwidgets.c
index 1100bbe..b37e03f 100644
--- a/tkwidgets.c
+++ b/tkwidgets.c
@@ -228,14 +228,14 @@ void tkwidgets_erase_y_scrollbar(t_symbol *widget_id, t_symbol *scrollbar_id)
void tkwidgets_bind_key_events(t_symbol *canvas_id, t_symbol *widget_id)
{
#ifdef __APPLE__
- sys_vgui("bind %s <Mod1-Key> {::pd_bindings::sendkey %s %%K 0}\n",
+ sys_vgui("bind %s <Mod1-Key> {pdtk_canvas_ctrlkey %s %%K 0}\n",
widget_id->s_name, canvas_id->s_name);
- sys_vgui("bind %s <Mod1-Shift-Key> {::pd_bindings::sendkey %s %%K 1}\n",
+ sys_vgui("bind %s <Mod1-Shift-Key> {pdtk_canvas_ctrlkey %s %%K 1}\n",
widget_id->s_name, canvas_id->s_name);
#else
- sys_vgui("bind %s <Control-Key> {::pd_bindings::sendkey %s %%K 0}\n",
+ sys_vgui("bind %s <Control-Key> {pdtk_canvas_ctrlkey %s %%K 0}\n",
widget_id->s_name, canvas_id->s_name);
- sys_vgui("bind %s <Control-Shift-Key> {::pd_bindings::sendkey %s %%K 1}\n",
+ sys_vgui("bind %s <Control-Shift-Key> {pdtk_canvas_ctrlkey %s %%K 1}\n",
widget_id->s_name, canvas_id->s_name);
#endif
}
@@ -243,7 +243,7 @@ void tkwidgets_bind_key_events(t_symbol *canvas_id, t_symbol *widget_id)
void tkwidgets_bind_mouse_events(t_symbol *canvas_id, t_symbol *widget_id)
{
/* mouse buttons */
- sys_vgui("bind %s <Button> {pdtk_canvas_mouse %s \
+ sys_vgui("bind %s <Button> {pdtk_canvas_sendclick %s \
[expr %%X - [winfo rootx %s]] [expr %%Y - [winfo rooty %s]] %%b 0}\n",
widget_id->s_name, canvas_id->s_name,
canvas_id->s_name, canvas_id->s_name);