#include <glib.h>
#include <gtk/gtk.h>

static void add_page (GtkWidget *notebook, GtkTooltips *tips)
{
	GtkWidget *tablabel, *label, *ebox;

	label = gtk_label_new ("Page");
	gtk_widget_show (label);

	ebox = gtk_event_box_new ();
	tablabel = gtk_label_new ("Tab label");
	gtk_widget_show (ebox);
	gtk_widget_show (tablabel);
	gtk_container_add (GTK_CONTAINER (ebox), tablabel);
	gtk_tooltips_set_tip (tips, ebox, "Tab label tip text", NULL);
	
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label, ebox);
}

int main(int argc, char **argv)
{
	GtkWidget *window, *notebook;
	GtkTooltips *tips;

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

	notebook = gtk_notebook_new ();
	gtk_container_add (GTK_CONTAINER (window), notebook);

	tips = gtk_tooltips_new ();
	gtk_tooltips_set_tip (tips, notebook, "Notebook tip text", NULL);

	add_page (notebook, tips);
	add_page (notebook, tips);
	gtk_widget_show_all (window);

	g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);

	gtk_main ();

	return 0;
}
