Re: new_from_stock



Hi Andrew,

   I'm using gtkmm-2.4 on Windows with VC7.1. I am trying to set an image
   for a button. I've tried your suggestion but I couldn't get the image
   shown;

   Gtk::Image *img =
     new Gtk::Image(Gtk::StockID("gtk-stop", Gtk::IconSize(1));
   my_button->set_image(*img);

   and I've previously tried this one too;

   my_button->set_image(Gtk::Image(Gtk:Stock::Add,
                                   Gtk::IconSize(Gtk::ICON_SIZE_BUTTON)));

   however, none of them shows that button with an image, there's just
   a label but no image.

   I couldn't find enough documentation in gtk+ and gtkmm documentations.

Thanks,

  emre

On Sat, Apr 23, 2005 at 04:03:15PM -0400, Andrew Krause wrote:
> Emre,
> 
> You really don't need that function if you declare your Gtk::Image as a 
> pointer, because you can just use:
> 
> Gtk::Image *img = new Gtk::Image(Gtk::StockID("gtk-stop"), 
> Gtk::IconSize(1));
> 
> To create a stop image for example. You can use the Gtk::StockID for any 
> type of image or Gtk::STOCK::STOP for menu items. I know this doesn't 
> really answer your question, but it will atleast give you a way to do 
> what you are trying to do... - Andrew
> 
> Emre Turkay wrote:
> 
> >Hi Folks,
> >
> >  In the gtkmm documentation for Gtk::Image (and therefore in some .h
> >  files distributed with gtkmm) the method Gtk::Image::new_from_stock()
> >  is referred, however I couldn't find where it is defined (i.e., I
> >  'grep'ed the /usr/include/gtkmm-2.0 directory and couldn't find it.)
> >
> >  What may be wrong?
> >
> >Thanks,
> >
> > Emre
> >_______________________________________________
> >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]