summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-21 00:50:35 +0000
committerDavid Robillard <d@drobilla.net>2011-05-21 00:50:35 +0000
commit2f86a3e8fd1e848375981ec62bbf600885b1f841 (patch)
tree86512895e60913dc2e9f49d79a6f81aeec37e714
parentdc255319ff35012b892ed3ee2bb0d311ebe1a670 (diff)
downloadingen-2f86a3e8fd1e848375981ec62bbf600885b1f841.tar.gz
ingen-2f86a3e8fd1e848375981ec62bbf600885b1f841.tar.bz2
ingen-2f86a3e8fd1e848375981ec62bbf600885b1f841.zip
Load UI file from window level (fixes unparented widget warnings).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3306 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/ControlPanel.cpp9
-rw-r--r--src/gui/PatchView.cpp3
2 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/ControlPanel.cpp b/src/gui/ControlPanel.cpp
index a3964cf5..667157ce 100644
--- a/src/gui/ControlPanel.cpp
+++ b/src/gui/ControlPanel.cpp
@@ -87,18 +87,19 @@ ControlPanel::add_port(SharedPtr<const PortModel> pm)
// Add port
if (pm->is_input()) {
+ Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win");
if (pm->is_toggle()) {
ToggleControl* tc;
- WidgetFactory::get_widget_derived("toggle_control", tc);
+ xml->get_widget_derived("toggle_control", tc);
control = tc;
} else if (pm->is_a(PortType::CONTROL)
- || pm->supports(App::instance().uris().atom_Float32)) {
+ || pm->supports(App::instance().uris().atom_Float32)) {
SliderControl* sc;
- WidgetFactory::get_widget_derived("control_strip", sc);
+ xml->get_widget_derived("control_strip", sc);
control = sc;
} else if (pm->supports(App::instance().uris().atom_String)) {
StringControl* sc;
- WidgetFactory::get_widget_derived("string_control", sc);
+ xml->get_widget_derived("string_control", sc);
control = sc;
}
}
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp
index 19ff35d6..6431afb4 100644
--- a/src/gui/PatchView.cpp
+++ b/src/gui/PatchView.cpp
@@ -118,7 +118,8 @@ SharedPtr<PatchView>
PatchView::create(SharedPtr<const PatchModel> patch)
{
PatchView* result = NULL;
- WidgetFactory::get_widget_derived("patch_view_box", result);
+ Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win");
+ xml->get_widget_derived("patch_view_box", result);
assert(result);
result->set_patch(patch);
return SharedPtr<PatchView>(result);