[gtk+] Add gtk_assistant_remove_page



commit 86fcb8b66fa80df7c65fa463d895562a0fa2b41f
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jul 11 21:46:38 2011 -0400

    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(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index be082f8..c897e1b 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 b6801e0..38ff633 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 0f289d5..4af319b 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1649,6 +1649,30 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
 }
 
 /**
+ * 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
  * @page_func: (allow-none): the #GtkAssistantPageFunc, or %NULL
diff --git a/gtk/gtkassistant.h b/gtk/gtkassistant.h
index b148369..3caff0b 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]