Re: Button with image

Beast said:

1. Is it possible to create new button with image without adding in

Of course.  The stock stuff is a convenience wrapper to do a bunch of
gruntwork for you.

  $button = Gtk2::Button->new ();  # note, no label
  $image = Gtk2::Image->new_from_pixbuf ($pixbuf);
  $button->add ($image);
  $image->show ();

If you want an image and a label, pack them into a box and add the box to the

2. I can not found gtk_stock_add documentation in gtk+ site, however it
was there in gtk-perl site, is Gtk2::Stock only available in gtk-perl?

Nope, it comes from gtk+.  The page is called "Stock Items":

In addition to the example that comes with Gtk2, there's
an example of registering stock icons in the "migrating from GnomeUIInfo"
section of the gtk+ manual:

The two examples take slightly different approaches.

muppet <scott at asofyet dot org>

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