void gedit_multi_notebook_add_new_notebook_with_tab (GeditMultiNotebook *mnb, GeditTab *tab) { GtkWidget *notebook; GeditNotebook *old_notebook; g_return_if_fail (GEDIT_IS_MULTI_NOTEBOOK (mnb)); g_return_if_fail (GEDIT_IS_TAB (tab)); notebook = gedit_notebook_new (); add_notebook (mnb, notebook, FALSE); old_notebook = gedit_multi_notebook_get_notebook_for_tab (mnb, tab); /* When gtk_notebook_insert_page is called the focus is set in the notebook, we don't want this to happen until the page is added. Also we don't want to call switch_page when we add the tab but when we switch the notebook. */ g_signal_handlers_block_by_func (old_notebook, notebook_set_focus, mnb); g_signal_handlers_block_by_func (old_notebook, notebook_switch_page, mnb); gedit_notebook_move_tab (old_notebook, GEDIT_NOTEBOOK (notebook), tab, -1); g_signal_handlers_unblock_by_func (old_notebook, notebook_switch_page, mnb); g_signal_handlers_unblock_by_func (old_notebook, notebook_set_focus, mnb); notebook_set_focus (GTK_CONTAINER (notebook), NULL, mnb); }
static void gedit_multi_notebook_init (GeditMultiNotebook *mnb) { GeditMultiNotebookPrivate *priv; mnb->priv = gedit_multi_notebook_get_instance_private (mnb); priv = mnb->priv; priv->removing_notebook = FALSE; gtk_orientable_set_orientation (GTK_ORIENTABLE (mnb), GTK_ORIENTATION_VERTICAL); priv->show_tabs_mode = GEDIT_NOTEBOOK_SHOW_TABS_ALWAYS; priv->show_tabs = TRUE; priv->ui_settings = g_settings_new ("org.gnome.gedit.preferences.ui"); g_settings_bind (priv->ui_settings, GEDIT_SETTINGS_SHOW_TABS_MODE, mnb, "show-tabs-mode", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET); priv->active_notebook = gedit_notebook_new (); add_notebook (mnb, priv->active_notebook, TRUE); }
static void gedit_multi_notebook_init (GeditMultiNotebook *mnb) { mnb->priv = gedit_multi_notebook_get_instance_private (mnb); mnb->priv->removing_notebook = FALSE; gtk_orientable_set_orientation (GTK_ORIENTABLE (mnb), GTK_ORIENTATION_VERTICAL); mnb->priv->active_notebook = gedit_notebook_new (); add_notebook (mnb, mnb->priv->active_notebook, TRUE); }
static void gedit_multi_notebook_init (GeditMultiNotebook *mnb) { mnb->priv = GEDIT_MULTI_NOTEBOOK_GET_PRIVATE (mnb); mnb->priv->removing_notebook = FALSE; gtk_orientable_set_orientation (GTK_ORIENTABLE (mnb), GTK_ORIENTATION_VERTICAL); mnb->priv->active_notebook = gedit_notebook_new (); add_notebook (mnb, mnb->priv->active_notebook, TRUE); }