fix gtk "child->parent == NULL" asserts
This commit is contained in:
parent
35703cb3fc
commit
bc434841d2
@ -184,11 +184,19 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
|
|||||||
, _pi(pi)
|
, _pi(pi)
|
||||||
, _lv2(lv2p)
|
, _lv2(lv2p)
|
||||||
, _gui_widget(NULL)
|
, _gui_widget(NULL)
|
||||||
, _ardour_buttons_box(NULL)
|
|
||||||
, _values(NULL)
|
, _values(NULL)
|
||||||
, _external_ui_ptr(NULL)
|
, _external_ui_ptr(NULL)
|
||||||
, _inst(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
|
void
|
||||||
@ -219,18 +227,11 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
|
|||||||
features[features_count - 1] = &_external_ui_feature;
|
features[features_count - 1] = &_external_ui_feature;
|
||||||
features[features_count] = NULL;
|
features[features_count] = NULL;
|
||||||
} else {
|
} else {
|
||||||
_ardour_buttons_box = manage (new Gtk::HBox);
|
if (_ardour_buttons_box.get_parent()) {
|
||||||
_ardour_buttons_box->set_spacing (6);
|
_ardour_buttons_box.get_parent()->remove(_ardour_buttons_box);
|
||||||
_ardour_buttons_box->set_border_width (6);
|
}
|
||||||
_ardour_buttons_box->pack_end (focus_button, false, false);
|
pack_start(_ardour_buttons_box, false, false);
|
||||||
_ardour_buttons_box->pack_end (bypass_button, false, false, 10);
|
_ardour_buttons_box.show_all();
|
||||||
_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);
|
|
||||||
|
|
||||||
_gui_widget = Gtk::manage((container = new Gtk::Alignment()));
|
_gui_widget = Gtk::manage((container = new Gtk::Alignment()));
|
||||||
pack_start(*_gui_widget, true, true);
|
pack_start(*_gui_widget, true, true);
|
||||||
|
@ -73,7 +73,7 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox
|
|||||||
sigc::connection _screen_update_connection;
|
sigc::connection _screen_update_connection;
|
||||||
Gtk::Widget* _gui_widget;
|
Gtk::Widget* _gui_widget;
|
||||||
/** a box containing the focus, bypass, delete, save / add preset buttons etc. */
|
/** a box containing the focus, bypass, delete, save / add preset buttons etc. */
|
||||||
Gtk::HBox* _ardour_buttons_box;
|
Gtk::HBox _ardour_buttons_box;
|
||||||
float* _values;
|
float* _values;
|
||||||
std::vector<ControllableRef> _controllables;
|
std::vector<ControllableRef> _controllables;
|
||||||
struct lv2_external_ui_host _external_ui_host;
|
struct lv2_external_ui_host _external_ui_host;
|
||||||
|
@ -336,6 +336,13 @@ PortMatrix::select_arrangement ()
|
|||||||
_vbox.pack_end (_vnotebook, false, false);
|
_vbox.pack_end (_vnotebook, false, false);
|
||||||
_vbox.pack_end (_vspacer, true, true);
|
_vbox.pack_end (_vspacer, true, true);
|
||||||
|
|
||||||
|
#define REMOVE_FROM_GTK_PARENT(WGT) if ((WGT).get_parent()) { (WGT).get_parent()->remove(WGT);}
|
||||||
|
REMOVE_FROM_GTK_PARENT(*_body)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_vscroll)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_hscroll)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_vbox)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_hbox)
|
||||||
|
|
||||||
attach (*_body, 2, 3, 1, 2, FILL | EXPAND, FILL | EXPAND);
|
attach (*_body, 2, 3, 1, 2, FILL | EXPAND, FILL | EXPAND);
|
||||||
attach (_vscroll, 3, 4, 1, 2, SHRINK);
|
attach (_vscroll, 3, 4, 1, 2, SHRINK);
|
||||||
attach (_hscroll, 2, 3, 3, 4, FILL | EXPAND, SHRINK);
|
attach (_hscroll, 2, 3, 3, 4, FILL | EXPAND, SHRINK);
|
||||||
@ -355,6 +362,12 @@ PortMatrix::select_arrangement ()
|
|||||||
_vbox.pack_end (_vnotebook, false, false);
|
_vbox.pack_end (_vnotebook, false, false);
|
||||||
_vbox.pack_end (_vlabel, false, false);
|
_vbox.pack_end (_vlabel, false, false);
|
||||||
|
|
||||||
|
REMOVE_FROM_GTK_PARENT(*_body)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_vscroll)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_hscroll)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_vbox)
|
||||||
|
REMOVE_FROM_GTK_PARENT(_hbox)
|
||||||
|
|
||||||
attach (*_body, 1, 2, 2, 3, FILL | EXPAND, FILL | EXPAND);
|
attach (*_body, 1, 2, 2, 3, FILL | EXPAND, FILL | EXPAND);
|
||||||
attach (_vscroll, 3, 4, 2, 3, SHRINK);
|
attach (_vscroll, 3, 4, 2, 3, SHRINK);
|
||||||
attach (_hscroll, 1, 2, 3, 4, FILL | EXPAND, SHRINK);
|
attach (_hscroll, 1, 2, 3, 4, FILL | EXPAND, SHRINK);
|
||||||
|
Loading…
Reference in New Issue
Block a user