summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2005-11-29 22:48:54 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2005-11-29 22:48:54 +0000
commitad8028554827f9e72dd978e218a3d9538e30d8de (patch)
tree800b8e3066f01328a7ebc72a892abccb727b9861 /gtk2_ardour/utils.cc
parent0f5dc815418c20de2658c27e59a7ef9bc451907d (diff)
more fixes to get things moving along
git-svn-id: svn://localhost/trunk/ardour2@151 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 8998b56229..9d1966b10e 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -480,8 +480,20 @@ pane_handler (GdkEventButton* ev, Gtk::Paned* pane)
uint32_t
rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a)
{
+ /* In GTK+2, styles aren't set up correctly if the widget is not
+ attached to a toplevel window that has a screen pointer.
+ */
+
+ static Gtk::Window* window = 0;
+
+ if (window == 0) {
+ window = new Window (WINDOW_TOPLEVEL);
+ }
+
Gtk::Label foo;
+ window->add (foo);
+
foo.set_name (style);
foo.ensure_style ();
@@ -499,6 +511,8 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a)
} else {
warning << string_compose (_("missing RGBA style for \"%1\""), style) << endl;
}
+
+ window->remove ();
return (uint32_t) RGBA_TO_UINT(r,g,b,a);
}