コード例 #1
0
ファイル: actions.c プロジェクト: ptomato/gnome-inform7
/* Edit->Undo */
void
action_undo(GtkAction *action, I7Document *document)
{
	GtkSourceBuffer *buffer = i7_document_get_buffer(document);
	if(gtk_source_buffer_can_undo(buffer))
		gtk_source_buffer_undo(buffer);

	/* Update the "sensitive" state of the undo and redo actions */
	gtk_action_set_sensitive(action, gtk_source_buffer_can_undo(buffer));
	gtk_action_set_sensitive(document->redo, gtk_source_buffer_can_redo(buffer));
}
コード例 #2
0
/* Returns the number of undo's. */
static gint
test_undo_redo (GtkSourceBuffer *buffer,
		gint             max_actions)
{
	gint nb_actions;
	gint i;

	for (nb_actions = 0; nb_actions < max_actions; nb_actions++)
	{
		if (gtk_source_buffer_can_undo (buffer))
		{
			gtk_source_buffer_undo (buffer);
		}
		else
		{
			break;
		}
	}

	for (i = 0; i < nb_actions; i++)
	{
		g_assert (gtk_source_buffer_can_redo (buffer));
		gtk_source_buffer_redo (buffer);
	}

	return nb_actions;
}
コード例 #3
0
ファイル: tpad_history.c プロジェクト: gnaservicesinc/tpad
void do_undo(){
   if(gtk_source_buffer_can_undo(GTK_SOURCE_BUFFER(mBuff))) gtk_source_buffer_undo(GTK_SOURCE_BUFFER(mBuff));
}
コード例 #4
0
ファイル: menu_edit.c プロジェクト: kawatea/cedit
//元に戻せるかどうかの状態が変わったときの動作
void change_undo(void)
{
    set_action("Undo", gtk_source_buffer_can_undo(buffer));
}