示例#1
0
/**
 * srm_trainer_tab_add_to_window:
 * @tab: a #SrmTrainerTab instance
 * @window: the #GeditWindow to add a tab to
 * @jump_to: true if the newly added tab should be activated after its added
 *
 * Adds the tab to the supplied #GeditWindow instance's active #GeditNotebook.
 */
void srm_trainer_tab_add_to_window (
    GeditTab * tab
    , GeditWindow * window
    , gboolean jump_to
)
{
    GtkWidget * notebook;

    if (window == NULL || tab == NULL)
    {
        return;
    }

    g_return_if_fail (GEDIT_IS_WINDOW (window));
    g_return_if_fail (GEDIT_IS_TAB (tab));

    notebook = _gedit_window_get_notebook (window);

    gtk_widget_show (GTK_WIDGET (tab));

    gedit_notebook_add_tab (GEDIT_NOTEBOOK (notebook),
                            GEDIT_TAB (tab),
                            -1,
                            jump_to);

    if (!gtk_widget_get_visible (GTK_WIDGET (window)))
    {
        gtk_window_present (GTK_WINDOW (window));
    }
}
void
_gedit_cmd_documents_next_document (GtkAction   *action,
				    GeditWindow *window)
{
	GtkNotebook *notebook;

	gedit_debug (DEBUG_COMMANDS);

	notebook = GTK_NOTEBOOK (_gedit_window_get_notebook (window));
	gtk_notebook_next_page (notebook);
}
void
_gedit_cmd_documents_next_document (GSimpleAction *action,
                                    GVariant      *parameter,
                                    gpointer       user_data)
{
	GeditWindow *window = GEDIT_WINDOW (user_data);
	GtkNotebook *notebook;

	gedit_debug (DEBUG_COMMANDS);

	notebook = GTK_NOTEBOOK (_gedit_window_get_notebook (window));
	gtk_notebook_next_page (notebook);
}
示例#4
0
static GtkTreePath *
get_current_path (GeditDocumentsPanel *panel)
{
	gint notebook_num;
	gint page_num;
	GtkWidget *notebook;

	gedit_debug (DEBUG_PANEL);

	notebook = _gedit_window_get_notebook (panel->priv->window);

	notebook_num = gedit_multi_notebook_get_notebook_num (panel->priv->mnb,
							      GEDIT_NOTEBOOK (notebook));
	page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));

	return gtk_tree_path_new_from_indices (notebook_num, page_num, -1);
}