From 86560309aa26b8cbb08bcfab85c7bc50a87794ab Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 4 Jul 2011 19:15:50 +0000 Subject: Simplify FlowCanvas menu API, and fix crashing Ingen menus (ticket #721). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3411 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/Port.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/gui/Port.cpp') diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index bc623950..ab48f30b 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -75,9 +75,6 @@ Port::Port(FlowCanvas::Module& module, { assert(pm); - delete _menu; - _menu = NULL; - ArtVpathDash* dash = this->dash(); _rect.property_dash() = dash; set_border_width(dash ? 2.0 : 0.0); @@ -121,13 +118,14 @@ Port::update_metadata() } } -void -Port::create_menu() +bool +Port::show_menu(GdkEventButton* ev) { PortMenu* menu = NULL; - WidgetFactory::get_widget_derived("object_menu", menu); + WidgetFactory::get_widget_derived("port_menu", menu); menu->init(model(), _flipped); - set_menu(menu); + menu->popup(ev->button, ev->time); + return true; } void -- cgit v1.2.1