I put this notebook example together from glade-0.6 (not all the stuff is necessary, but I tried to get the equivalent actions to gtkdialog)
Code: Select all
#include <gtk/gtk.h>
int main (int argc, char *argv[]){
GtkWidget *window1, *notebook1, *frame1, *label4, *label1, *frame2, *label5, *label2;
gtk_set_locale ();
gtk_init (&argc, &argv);
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (window1, "window1");
gtk_object_set_data (GTK_OBJECT (window1), "window1", window1);
gtk_window_set_title (GTK_WINDOW (window1), "window1");
notebook1 = gtk_notebook_new ();
gtk_widget_set_name (notebook1, "notebook1");
gtk_widget_ref (notebook1);
gtk_object_set_data_full (GTK_OBJECT (window1), "notebook1", notebook1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (notebook1);
gtk_container_add (GTK_CONTAINER (window1), notebook1);
frame1 = gtk_frame_new ("frame1");
gtk_widget_set_name (frame1, "frame1");
gtk_widget_ref (frame1);
gtk_object_set_data_full (GTK_OBJECT (window1), "frame1", frame1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame1);
gtk_container_add (GTK_CONTAINER (notebook1), frame1);
label4 = gtk_label_new ("label4");
gtk_widget_set_name (label4, "label4");
gtk_widget_ref (label4);
gtk_object_set_data_full (GTK_OBJECT (window1), "label4", label4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label4);
gtk_container_add (GTK_CONTAINER (frame1), label4);
label1 = gtk_label_new ("label1");
gtk_widget_set_name (label1, "label1");
gtk_widget_ref (label1);
gtk_object_set_data_full (GTK_OBJECT (window1), "label1", label1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label1);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);
frame2 = gtk_frame_new (NULL);
gtk_widget_set_name (frame2, "frame2");
gtk_widget_ref (frame2);
gtk_object_set_data_full (GTK_OBJECT (window1), "frame2", frame2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame2);
gtk_container_add (GTK_CONTAINER (notebook1), frame2);
label5 = gtk_label_new ("label5");
gtk_widget_set_name (label5, "label5");
gtk_widget_ref (label5);
gtk_object_set_data_full (GTK_OBJECT (window1), "label5", label5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label5);
gtk_container_add (GTK_CONTAINER (frame2), label5);
label2 = gtk_label_new ("label2");
gtk_widget_set_name (label2, "label2");
gtk_widget_ref (label2);
gtk_object_set_data_full (GTK_OBJECT (window1), "label2", label2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label2);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);
gtk_widget_show (window1);
gtk_main ();
return 0;
}
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].