Re: GTK_STOCK_CLOSE Button Without Label



Annamalai Gurusami wrote:
Hi All.

Currently I am working on a GTK+ application which contains a
GtkNotebook.  The pages for a GtkNotebook will be added and
removed/hidden dynamically.

To allow the end user to close tabs, I am adding button to the title
or label portion of the GtkNotebook.  I would like to use the stock
button GTK_STOCK_CLOSE for this purpose.  And I don't want any "Close"
word displayed on that button.  What to do for this?  (Similar to
Galeon.)

I am using gtk version 2.4.3.

First get your image:
http://developer.gnome.org/doc/API/2.0/gtk/GtkImage.html#gtk-image-new-from-stock

In GTK+ 2.6 you can use:
http://developer.gnome.org/doc/API/2.0/gtk/GtkButton.html#gtk-button-set-image

In 2.4 I guess you can simply:

button = gtk_button_new ();
image  = gtk_image_new_from_stock (...);
gtk_container_add (GTK_CONTAINER (button), image);

Cheers,
                           -Tristan



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