static void gedit_notebook_page_removed (GtkNotebook *notebook, GtkWidget *page, guint page_num) { GeditNotebook *nb = GEDIT_NOTEBOOK (notebook); gint curr; GtkWidget *tab_label; tab_label = get_tab_label (GEDIT_TAB (page)); if (tab_label != NULL) { g_signal_handlers_disconnect_by_func (tab_label, G_CALLBACK (on_tab_label_destroyed), page); g_signal_handlers_disconnect_by_func (tab_label, G_CALLBACK (close_button_clicked_cb), nb); } /* Remove the page from the focused pages list */ nb->priv->focused_pages = g_list_remove (nb->priv->focused_pages, page); curr = gtk_notebook_get_current_page (notebook); if (page_num == curr) { smart_tab_switching_on_closure (nb, GEDIT_TAB (page)); } }
void ui_playlist_notebook_update (void * data, void * user) { gint global_level = GPOINTER_TO_INT (data); if (global_level == PLAYLIST_UPDATE_STRUCTURE) add_remove_pages (); gint lists = aud_playlist_count (); for (gint list = 0; list < lists; list ++) { if (global_level >= PLAYLIST_UPDATE_METADATA) set_tab_label (list, get_tab_label (list)); gint at, count; gint level = aud_playlist_updated_range (list, & at, & count); if (level) ui_playlist_widget_update (playlist_get_treeview (list), level, at, count); } gtk_notebook_set_current_page ((GtkNotebook *) notebook, aud_playlist_get_active ()); do_follow (); }
static void set_close_buttons_sensitivity (GeditTab *tab, GeditNotebook *nb) { GtkWidget *tab_label; tab_label = get_tab_label (tab); gedit_tab_label_set_close_button_sensitive (GEDIT_TAB_LABEL (tab_label), nb->priv->close_buttons_sensitive); }
static void set_close_buttons_sensitivity (PlumaTab *tab, PlumaNotebook *nb) { GtkWidget *tab_label; tab_label = get_tab_label (tab); pluma_tab_label_set_close_button_sensitive (PLUMA_TAB_LABEL (tab_label), nb->priv->close_buttons_sensitive); }
static void remove_tab_label (CeditNotebook *nb, CeditTab *tab) { GtkWidget *tab_label; tab_label = get_tab_label (tab); g_signal_handlers_disconnect_by_func (tab_label, G_CALLBACK (close_button_clicked_cb), nb); g_object_set_data (G_OBJECT (tab), "tab-label", NULL); }
static void gedit_notebook_page_added (GtkNotebook *notebook, GtkWidget *page, guint page_num) { GeditNotebook *nb = GEDIT_NOTEBOOK (notebook); GtkWidget *tab_label; tab_label = get_tab_label (GEDIT_TAB (page)); g_signal_connect (tab_label, "destroy", G_CALLBACK (on_tab_label_destroyed), page); g_signal_connect (tab_label, "close-clicked", G_CALLBACK (close_button_clicked_cb), nb); }
static void gedit_notebook_page_removed (GtkNotebook *notebook, GtkWidget *page, guint page_num) { GeditNotebook *nb = GEDIT_NOTEBOOK (notebook); gint num_pages; gint curr; GtkWidget *tab_label; tab_label = get_tab_label (GEDIT_TAB (page)); if (tab_label != NULL) { g_signal_handlers_disconnect_by_func (tab_label, G_CALLBACK (on_tab_label_destroyed), page); g_signal_handlers_disconnect_by_func (tab_label, G_CALLBACK (close_button_clicked_cb), nb); } /* Remove the page from the focused pages list */ nb->priv->focused_pages = g_list_remove (nb->priv->focused_pages, page); curr = gtk_notebook_get_current_page (notebook); if (page_num == curr) { smart_tab_switching_on_closure (nb, GEDIT_TAB (page)); } num_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)); /* If there is no tabs, calling this is pointless */ if (num_pages > 0) { update_tabs_visibility (nb, FALSE); } }