Mercurial > pidgin.yaz
diff gtk/gtkscrollbook.c @ 15182:fbe2187bceec
[gaim-migrate @ 17968]
incomplete. Working on this from home. You may see where it's going.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 12 Dec 2006 04:45:02 +0000 |
parents | 9b2a65069744 |
children | a505577b6f4b |
line wrap: on
line diff
--- a/gtk/gtkscrollbook.c Tue Dec 12 03:30:49 2006 +0000 +++ b/gtk/gtkscrollbook.c Tue Dec 12 04:45:02 2006 +0000 @@ -92,7 +92,6 @@ refresh_scroll_box(GtkGaimScrollBook *scroll_book, int index, int count) { char *label; - gtk_widget_show_all(GTK_WIDGET(scroll_book)); if (count <= 1) gtk_widget_hide(GTK_WIDGET(scroll_book->hbox)); @@ -120,9 +119,10 @@ static void page_count_change_cb(GtkGaimScrollBook *scroll_book) { + int count; int index = gtk_notebook_get_current_page(GTK_NOTEBOOK(scroll_book->notebook)); #if GTK_CHECK_VERSION(2,2,0) - int count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(scroll_book->notebook)); + count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(scroll_book->notebook)); #else count = g_list_length(GTK_NOTEBOOK(scroll_book->notebook)->children); #endif @@ -146,6 +146,7 @@ { gtk_widget_show(widget); gtk_notebook_append_page(GTK_NOTEBOOK(GTK_GAIM_SCROLL_BOOK(container)->notebook), widget, NULL); + page_count_change_cb(GTK_GAIM_SCROLL_BOOK(container)); } static void @@ -155,9 +156,8 @@ gpointer callback_data) { GtkGaimScrollBook *scroll_book = GTK_GAIM_SCROLL_BOOK(container); - if (include_internals) { + if (include_internals) (*callback)(scroll_book->hbox, callback_data); - } (*callback)(scroll_book->notebook, callback_data); } @@ -201,9 +201,10 @@ gtk_box_pack_start(GTK_BOX(scroll_book), scroll_book->notebook, TRUE, TRUE, 0); - g_signal_connect_swapped(G_OBJECT(scroll_book->notebook), "add", G_CALLBACK(page_count_change_cb), scroll_book); g_signal_connect_swapped(G_OBJECT(scroll_book->notebook), "remove", G_CALLBACK(page_count_change_cb), scroll_book); g_signal_connect(G_OBJECT(scroll_book->notebook), "switch-page", G_CALLBACK(switch_page_cb), scroll_book); + gtk_widget_show_all(scroll_book->hbox); + gtk_widget_show_all(scroll_book->notebook); }