Small "close_tab_button"



Hello all,

After 2 years of working with GTK+ I have hit a brick wall. The fact that it took 2 years for this to happen shows how good the documentation and the kit in general are!

Anyway here's my problem:
I'm implementing chat tabs in a notebook and I want to have a close button on each tab.
So I created an hbox Label widget packed with a gtk_label followed by the close_button and specified this as my tab_label widget in gtk_notebook_insert_page ()

This works nicely, *but*, the button is huge (see not_nice_big_button.png attached). There seems to be a lot of white space between the edge of the icon and the edges of the button itself.

I would love to have the same close_tab_button as in Firefox (see nice_small_button.png attached).

For reference here is the simple code I'm using to create the button:
GtkWidget *close_button = gtk_button_new ();
GtkWidget *close_icon = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON(close_button), close_icon);
[...]

So far I have played with resizing the button (but then the icon is butchered), and trying to remove to "inner-border" style property, but to no avail.

I could go all the way and re-invent the wheel by implementing a custom button based on event_box or other. But before I do that, and as I'm sure this is a fairly common problem, I just wanted to check the list :)
Any help much appreciated.

Regards
Julien


Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail®.

Attachment: not_nice_big_button.png
Description: PNG image

Attachment: nice_small_button.png
Description: PNG image



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