From 86fcb8b66fa80df7c65fa463d895562a0fa2b41f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 11 Jul 2011 21:46:38 -0400 Subject: [PATCH] Add gtk_assistant_remove_page This was suspiciously missing, considering we have the usual append/prepend/insert_page methods. --- docs/reference/gtk/gtk3-sections.txt | 1 + gtk/gtk.symbols | 1 + gtk/gtkassistant.c | 24 ++++++++++++++++++++++++ gtk/gtkassistant.h | 2 ++ 4 files changed, 28 insertions(+) diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index be082f840e..c897e1b940 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -354,6 +354,7 @@ gtk_assistant_get_nth_page gtk_assistant_prepend_page gtk_assistant_append_page gtk_assistant_insert_page +gtk_assistant_remove_page GtkAssistantPageFunc gtk_assistant_set_forward_page_func GtkAssistantPageType diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index b6801e06d6..38ff633b2f 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -244,6 +244,7 @@ gtk_assistant_page_type_get_type gtk_assistant_prepend_page gtk_assistant_previous_page gtk_assistant_remove_action_widget +gtk_assistant_remove_page gtk_assistant_set_current_page gtk_assistant_set_forward_page_func gtk_assistant_set_page_complete diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c index 0f289d5671..4af319bb46 100644 --- a/gtk/gtkassistant.c +++ b/gtk/gtkassistant.c @@ -1648,6 +1648,30 @@ gtk_assistant_insert_page (GtkAssistant *assistant, return position; } +/** + * gtk_assistant_remove_page: + * @assistant: a #GtkAssistant + * @page_num: the index of a page in the @assistant, + * or -1 to get the last page + * + * Removes the @page_num's page from @assistant. + * + * Since: 3.2 + */ +void +gtk_assistant_remove_page (GtkAssistant *assistant, + gint page_num) +{ + GtkWidget *page; + + g_return_if_fail (GTK_IS_ASSISTANT (assistant)); + + page = gtk_assistant_get_nth_page (assistant, page_num); + + if (page) + gtk_assistant_remove (assistant, page); +} + /** * gtk_assistant_set_forward_page_func: * @assistant: a #GtkAssistant diff --git a/gtk/gtkassistant.h b/gtk/gtkassistant.h index b1483691ff..3caff0bf50 100644 --- a/gtk/gtkassistant.h +++ b/gtk/gtkassistant.h @@ -139,6 +139,8 @@ gint gtk_assistant_append_page (GtkAssistant gint gtk_assistant_insert_page (GtkAssistant *assistant, GtkWidget *page, gint position); +void gtk_asssistant_remove_page (GtkAssistant *assistant, + gint page_num); void gtk_assistant_set_forward_page_func (GtkAssistant *assistant, GtkAssistantPageFunc page_func, gpointer data,