+2007-05-18 Carlos Garnacho <carlos@imendio.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_real_insert_page): Do not unset
+ the brand new current page if there was none set previously. Fixes
+ #425138 (Reported by Michail Crayson). Some code simplifications.
+ (gtk_notebook_draw_arrow): code style fix.
+
2007-05-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkpathbar.c: Add ATK names to the Up, Down, and Root
g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
gtk_widget_freeze_child_notify (child);
-
- page = g_new (GtkNotebookPage, 1);
+
+ page = g_new0 (GtkNotebookPage, 1);
page->child = child;
- page->last_focus_child = NULL;
- page->requisition.width = 0;
- page->requisition.height = 0;
- page->allocation.x = 0;
- page->allocation.y = 0;
- page->allocation.width = 0;
- page->allocation.height = 0;
- page->default_menu = FALSE;
- page->default_tab = FALSE;
- page->mnemonic_activate_signal = 0;
- page->reorderable = FALSE;
- page->detachable = FALSE;
-
+
nchildren = g_list_length (notebook->children);
if ((position < 0) || (position > nchildren))
position = nchildren;
{
page->default_tab = TRUE;
if (notebook->show_tabs)
- tab_label = gtk_label_new ("");
+ tab_label = gtk_label_new (NULL);
}
page->tab_label = tab_label;
page->menu_label = menu_label;
if (!notebook->cur_page)
{
gtk_notebook_switch_page (notebook, page, 0);
- gtk_notebook_switch_focus_tab (notebook, NULL);
+ /* focus_tab is set in the switch_page method */
+ gtk_notebook_switch_focus_tab (notebook, notebook->focus_tab);
}
gtk_notebook_update_tab_states (notebook);
if (notebook->focus_tab &&
!gtk_notebook_search_page (notebook, notebook->focus_tab,
- left? STEP_PREV : STEP_NEXT, TRUE))
+ left ? STEP_PREV : STEP_NEXT, TRUE))
{
shadow_type = GTK_SHADOW_ETCHED_IN;
state_type = GTK_STATE_INSENSITIVE;