Re: displaying an image



I presume the code that you've show in in a Gtk::Window derative class?
And I presume that you've already added "vertial_box" to you window?

Bear in mind I have no experience with ::Inage, but ask why the pointer?
Gtk::Image iconImage("Positive-48.png");    // this should work too I think

then your pack will look neater IMO:
vertical_box->pack_start( icon_image , Gtk::PACK_SHRINK, 0);

Hope that's of help, -Harry

On Thu, Dec 23, 2010 at 5:31 PM, Charles Seedle <charles seedle rigaku com> wrote:

When I use:

 

Gtk::Image* icon_image = new Gtk::Image("Positive-48.png");

vertical_box->pack_start((Gtk::Widget&)*icon_image, Gtk::PACK_SHRINK, 0);

 

show_all_children();

 

in Gtkmm, I get a black box with no image displayed. If I do comparable code in Gtk+

I get a sharp looking image. What am I doing wrong ?

 

Randy Seedle


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]