summaryrefslogtreecommitdiff
path: root/gtk2_ardour/lv2_plugin_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-08-03 13:45:27 +0200
committerRobin Gareus <robin@gareus.org>2013-08-03 13:45:27 +0200
commit3ca63cc38c4f2de826e12e8c3b4bb24ff29b9b38 (patch)
treefd2081aaec9ed70656f1d4f5eef264f67b5ce9ee /gtk2_ardour/lv2_plugin_ui.cc
parentb14d9a6451124434e174c1d14393dab7f3641e82 (diff)
fix gtk "child->parent == NULL" asserts
Diffstat (limited to 'gtk2_ardour/lv2_plugin_ui.cc')
-rw-r--r--gtk2_ardour/lv2_plugin_ui.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc
index 2fe817a6a0..f9b15714f6 100644
--- a/gtk2_ardour/lv2_plugin_ui.cc
+++ b/gtk2_ardour/lv2_plugin_ui.cc
@@ -184,11 +184,19 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
, _pi(pi)
, _lv2(lv2p)
, _gui_widget(NULL)
- , _ardour_buttons_box(NULL)
, _values(NULL)
, _external_ui_ptr(NULL)
, _inst(NULL)
{
+ _ardour_buttons_box.set_spacing (6);
+ _ardour_buttons_box.set_border_width (6);
+ _ardour_buttons_box.pack_end (focus_button, false, false);
+ _ardour_buttons_box.pack_end (bypass_button, false, false, 10);
+ _ardour_buttons_box.pack_end (delete_button, false, false);
+ _ardour_buttons_box.pack_end (save_button, false, false);
+ _ardour_buttons_box.pack_end (add_button, false, false);
+ _ardour_buttons_box.pack_end (_preset_combo, false, false);
+ _ardour_buttons_box.pack_end (_preset_modified, false, false);
}
void
@@ -219,18 +227,11 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
features[features_count - 1] = &_external_ui_feature;
features[features_count] = NULL;
} else {
- _ardour_buttons_box = manage (new Gtk::HBox);
- _ardour_buttons_box->set_spacing (6);
- _ardour_buttons_box->set_border_width (6);
- _ardour_buttons_box->pack_end (focus_button, false, false);
- _ardour_buttons_box->pack_end (bypass_button, false, false, 10);
- _ardour_buttons_box->pack_end (delete_button, false, false);
- _ardour_buttons_box->pack_end (save_button, false, false);
- _ardour_buttons_box->pack_end (add_button, false, false);
- _ardour_buttons_box->pack_end (_preset_combo, false, false);
- _ardour_buttons_box->pack_end (_preset_modified, false, false);
- _ardour_buttons_box->show_all();
- pack_start(*_ardour_buttons_box, false, false);
+ if (_ardour_buttons_box.get_parent()) {
+ _ardour_buttons_box.get_parent()->remove(_ardour_buttons_box);
+ }
+ pack_start(_ardour_buttons_box, false, false);
+ _ardour_buttons_box.show_all();
_gui_widget = Gtk::manage((container = new Gtk::Alignment()));
pack_start(*_gui_widget, true, true);