Harry,
I tried that originally, but I got complier errors: ‘class Gdk::Pixbuf’ has no member named ‘render_to_drawable’ ‘get_style’ was not declared in this scope ‘RGB_DITHER_NONE’ is not a member of ‘Gdk’ (I'm including <gtkmm.h> and <gdkmm.h> and compiling with: g++ `pkg-config gtkmm-3.0 --cflags --libs`) I had a look in Pixbuf reference (http://developer.gnome.org/gtkmm/unstable/classGdk_1_1Pixbuf.html) and couldn't see any reference to render_to_drawable. I also couldn't find this in the headers or any of the widgets it's derived from. The gdkmm/gdk/pixbf.h had the comment: //Use Gdk::Drawable::draw_pixbuf() instead of gdk_pixbuf_render_to_drawable(), gdk_pixbuf_render_to_drawable_alpha(). Any ideas? From: Harry van Haaren [harryhaaren gmail com]
Sent: 02 August 2011 21:02 To: Thomas Harty Cc: Yann LEYDIER; gtkmm-list gnome org Subject: Re: Images in GTKmm Hi Thomas,
Gtk 3 uses Cairo for its drawing backend, so one option would be to subclass Gtk::DrawingArea, and then load a .png or so with Cairo, and copy that to the cairo surface (& hence the Gtk::DrawingArea), after which you can display the DrawingArea as a normal widget. Another option is to use Gdk::Pixbuf and friends. This might be the easier option, but provides less flexibility. This link provides up to date (ie: Gtk3) info on both: See this link: http://developer.gnome.org/gtkmm-tutorial/3.0/sec-draw-images.html.en Good luck! -Harry On Tue, Aug 2, 2011 at 6:49 PM, Thomas Harty
<t harty1 physics ox ac uk> wrote:
Thanks. It looks like these won't work in gtkmm3. E.g. the "Changes in gtkmm 3" notes: |