diff options
author | David Robillard <d@drobilla.net> | 2011-12-08 01:19:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-12-08 01:19:22 +0000 |
commit | 3382158d77d904bfdec50c30c3dfdec22d46df3b (patch) | |
tree | 359ab8beb3f7fb044216c4ea6378c6e32729dc14 /ganv | |
parent | 1acfac387f6851c881ef89ba4728d69a9e115b22 (diff) | |
download | ganv-3382158d77d904bfdec50c30c3dfdec22d46df3b.tar.gz ganv-3382158d77d904bfdec50c30c3dfdec22d46df3b.tar.bz2 ganv-3382158d77d904bfdec50c30c3dfdec22d46df3b.zip |
Fix node moving (inform user via "moved" signal).
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3833 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv')
-rw-r--r-- | ganv/Node.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ganv/Node.hpp b/ganv/Node.hpp index f83f11f..c36a8db 100644 --- a/ganv/Node.hpp +++ b/ganv/Node.hpp @@ -36,7 +36,9 @@ class Node : public Item { public: Node(Canvas* canvas, GanvNode* gobj) : Item(GNOME_CANVAS_ITEM(g_object_ref(gobj))) - {} + { + g_signal_connect(gobj, "moved", G_CALLBACK(on_moved), this); + } ~Node() { g_object_unref(_gobj); @@ -71,7 +73,11 @@ public: METHOD0(ganv_node, disconnect); - sigc::signal<void> signal_moved; + sigc::signal<void, double, double> signal_moved; + + static void on_moved(GanvNode* node, double x, double y) { + Glib::wrap(node)->signal_moved.emit(x, y); + } }; } // namespace Ganv |