Re: Is it possible to show a image in the notebook tab label place?



Hello,

Le 17/12/2007, Binary Chen <binary chen gmail com> a Ãcrit :
I want to show a picture in the notebook tab label place, instead just
show a plain text, how can I do this?
The tab label is not limited to GtkLabel. You can put whatever widget
you want (an image, a button...), see:
http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#gtk-notebook-append-page

Example of code:
GtkWidget *notebook, *hbox, *label, *image;

  hbox = gtk_hbox_new(FALSE, 0);
  label = gtk_label_new("Pouet");
  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  image = gtk_image_new_from_stock(GTK_STOCK_CLOSE,
                                   GTK_ICON_SIZE_MENU);
  gtk_box_pack_end(GTK_BOX(hbox), image, FALSE, FALSE, 2);
  gtk_widget_show_all(hbox);

  notebook = gtk_notebook_new();
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
                           child, hbox);

Damien.



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