summaryrefslogtreecommitdiffstats
path: root/ganv
diff options
context:
space:
mode:
Diffstat (limited to 'ganv')
-rw-r--r--ganv/Node.hpp10
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