diff options
-rw-r--r-- | ganv/Node.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ganv/Node.hpp b/ganv/Node.hpp index c9aaa63..4b219e6 100644 --- a/ganv/Node.hpp +++ b/ganv/Node.hpp @@ -38,8 +38,7 @@ public: : Item(GANV_ITEM(g_object_ref(gobj))) { g_signal_connect(gobj, "moved", G_CALLBACK(on_moved), this); - CONNECT_PROP_SIGNAL(gobj, selected, - on_notify<gboolean>, &Node::on_selected) + CONNECT_PROP_SIGNAL(gobj, selected, on_notify_bool, &Node::on_selected) } ~Node() { @@ -86,12 +85,21 @@ private: Glib::wrap(node)->_signal_moved.emit(x, y); } + /* GCC 4.6 can't handle this template<typename T> static void on_notify(GObject* gobj, GParamSpec* pspec, gpointer signal) { T value; g_object_get(gobj, g_param_spec_get_name(pspec), &value, NULL); ((sigc::signal<bool, T>*)signal)->emit(value); } + */ + static void on_notify_bool(GObject* gobj, + GParamSpec* pspec, + gpointer signal) { + gboolean value; + g_object_get(gobj, g_param_spec_get_name(pspec), &value, NULL); + ((sigc::signal<bool, gboolean>*)signal)->emit(value); + } }; } // namespace Ganv |