I took these changes from http://developer.gnome.org/gtk2/stable/GtkNotebook.html#GtkNotebook-switch-page