summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2006-03-14 05:44:35 +0000
committerDoug McLain <doug@nostar.net>2006-03-14 05:44:35 +0000
commit191f3239576f085befc2e1834de3ff6141023ffb (patch)
treeb5babe8a3418a4a5c6fbd6add2bf107e4477bf0c /libs
parentaf707897735a34ab1a82c7307dc61b12c14027a9 (diff)
moved gain rail and sliders to files. The previously unused 'from_files' portion of Pix::generate () had to ported to gtk2 as well.
git-svn-id: svn://localhost/trunk/ardour2@389 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/gtkmm2ext/pix.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/libs/gtkmm2ext/pix.cc b/libs/gtkmm2ext/pix.cc
index c9f759b321..ee7503b1c7 100644
--- a/libs/gtkmm2ext/pix.cc
+++ b/libs/gtkmm2ext/pix.cc
@@ -19,7 +19,8 @@
*/
#include <algorithm>
-
+#include <iostream>
+#include <gtkmm/window.h>
#include <gdkmm.h>
#include <gdkmm/pixmap.h>
@@ -140,12 +141,16 @@ Pix::generate ()
for (int i = 0; i < pixmap_count; i++) {
if (from_files) {
- string *strp;
- strp = (*files)[i];
- const char* str(strp->c_str());
+ static Gtk::Button* button = 0;
+ static const Gdk::Color color;
- pixmaps[i] = Gdk::Pixmap::create_from_xpm (Gdk::Colormap::get_system(),
- bitmaps[i], &str);
+ if (button == 0) {
+ button = new Gtk::Button ("blah"); //bogus button to extract a Gdk::Drawable from
+ }
+ const Glib::RefPtr<const Gdk::Drawable> drawable = button->get_window();
+
+ pixmaps[i] = Gdk::Pixmap::create_from_xpm (drawable, Gdk::Colormap::get_system(),
+ bitmaps[i], color, *(*files)[i]);
} else {
gchar **xpm;
xpm = const_cast<gchar **> (data[i]);