示例#1
0
void
gedit_multi_notebook_remove_active_notebook (GeditMultiNotebook *mnb)
{
	g_return_if_fail (GEDIT_IS_MULTI_NOTEBOOK (mnb));

	gedit_notebook_remove_all_tabs (GEDIT_NOTEBOOK (mnb->priv->active_notebook));
}
示例#2
0
static void
close_button_clicked (GtkCellRenderer     *cell,
                      const gchar         *path,
                      GeditDocumentsPanel *panel)
{
	GtkTreeIter iter;
	GeditTab *tab;
	GeditNotebook *notebook;

	if (!gtk_tree_model_get_iter_from_string (panel->priv->model,
	                                          &iter, path))
	{
	        return;
	}

	gtk_tree_model_get (panel->priv->model,
		            &iter,
		            NOTEBOOK_COLUMN, &notebook,
		            TAB_COLUMN, &tab,
		            -1);

	if (tab == NULL)
	{
		gedit_notebook_remove_all_tabs (notebook);
	}
	else
	{
		gtk_container_remove (GTK_CONTAINER (notebook),
		                      GTK_WIDGET (tab));
		g_object_unref (tab);
	}

	g_object_unref (notebook);
}
示例#3
0
/**
 * gedit_multi_notebook_close_all_tabs:
 * @mnb: a #GeditMultiNotebook
 *
 * Closes all opened tabs.
 */
void
gedit_multi_notebook_close_all_tabs (GeditMultiNotebook *mnb)
{
	GList *nbs, *l;

	g_return_if_fail (GEDIT_MULTI_NOTEBOOK (mnb));

	/* We copy the list because the main one is going to have the items
	   removed */
	nbs = g_list_copy (mnb->priv->notebooks);

	for (l = nbs; l != NULL; l = g_list_next (l))
	{
		gedit_notebook_remove_all_tabs (GEDIT_NOTEBOOK (l->data));
	}

	g_list_free (nbs);
}