Re: Tabs with icon



Hello.

To achieve this, simply pack GtkLabel and GtkButton into GtkHBox, then
set that GtkHBox as the tab widget for your notebook page.

Sample code:
---- CODE ----
hbox = gtk_hbox_new( FALSE, 6 );
gtk_box_pack_start( GTK_BOX( hbox ), gtk_label_new( "Tab1" ), TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( hbox ),
                    gtk_button_new_from_stock( GTK_STOCK_CLOSE ),
FALSE, FALSE, 0 );
gtk_widget_show_all( vbox );
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), child, hbox );
---- CODE ----

You'll probably want to tweak the buttons appearance a bit and connect
some signals to it, but other than that, the code should work as
expected.


2009/5/1 as2 <agent59624285 spamcorptastic com>:
>
> How can I get icons in tabs with GtkNotebook? Similar to how Firefox does it.
> There doesn't seem to be a way to use GtkNotebook directly to achieve this.
> --
> View this message in context: http://www.nabble.com/Tabs-with-icon-tp23338799p23338799.html
> Sent from the Gtk+ - General mailing list archive at Nabble.com.
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>



-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com


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