diff options
author | David Robillard <d@drobilla.net> | 2013-05-26 22:09:33 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-05-26 22:09:33 +0000 |
commit | 34602b0fabd8236297fb5033b43a458fc574ea8f (patch) | |
tree | ee4176d5d7712a81229d3800fbfd1021bb2478d6 /src | |
parent | 85d905775811463e18d5873f400db07a72a73ef6 (diff) | |
download | patchage-34602b0fabd8236297fb5033b43a458fc574ea8f.tar.gz patchage-34602b0fabd8236297fb5033b43a458fc574ea8f.tar.bz2 patchage-34602b0fabd8236297fb5033b43a458fc574ea8f.zip |
Fix port menu to allow disconnecting a single port from everything.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5111 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/PatchagePort.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/PatchagePort.hpp b/src/PatchagePort.hpp index 66e7d2b..24617f9 100644 --- a/src/PatchagePort.hpp +++ b/src/PatchagePort.hpp @@ -45,6 +45,8 @@ public: : Port(module, name, is_input, color) , _type(type) { + signal_event().connect( + sigc::mem_fun(this, &PatchagePort::on_event)); } virtual ~PatchagePort() {} @@ -54,17 +56,17 @@ public: return std::string(get_module()->get_label()) + ":" + get_label(); } - bool on_click(GdkEventButton* ev) { - if (ev->button != 3) { - return Ganv::Port::on_click(ev); + bool on_event(GdkEvent* ev) { + if (ev->type != GDK_BUTTON_PRESS || ev->button.button != 3) { + return false; } Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); menu->items().push_back( Gtk::Menu_Helpers::MenuElem( - "Disconnect All", sigc::mem_fun(this, &Port::disconnect))); + "Disconnect", sigc::mem_fun(this, &Port::disconnect))); - menu->popup(ev->button, ev->time); + menu->popup(ev->button.button, ev->button.time); return true; } |