[gnome-commander/gcmd-1-3] notebook: accept GtkWidget as label in insert_page(), prepend_page() and append_page()



commit 6f2e2b30aa91615fc6dc215c62cfde6cc08bb24e
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat Aug 1 15:52:24 2009 +0200

    notebook: accept GtkWidget as label in insert_page(), prepend_page() and append_page()

 src/gnome-cmd-notebook.h |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-cmd-notebook.h b/src/gnome-cmd-notebook.h
index b4e1ed2..3a1b0be 100644
--- a/src/gnome-cmd-notebook.h
+++ b/src/gnome-cmd-notebook.h
@@ -54,9 +54,12 @@ struct GnomeCmdNotebook
     GtkWidget *page()                   {  return gtk_notebook_get_nth_page (*this, get_current_page());  }
     GtkWidget *page(gint n)             {  return gtk_notebook_get_nth_page (*this, n);  }
 
-    gint insert_page(GtkWidget *page, gint n, const gchar *label=NULL);
-    gint prepend_page(GtkWidget *page, const gchar *label=NULL)             {  return insert_page(page, 0, label);   }
-    gint append_page(GtkWidget *page, const gchar *label=NULL)              {  return insert_page(page, -1, label);  }
+    gint insert_page(GtkWidget *page, gint n, GtkWidget *label=NULL);
+    gint insert_page(GtkWidget *page, gint n, const gchar *label)           {  return insert_page(page, n, label ? gtk_label_new (label) : NULL);  }
+    gint prepend_page(GtkWidget *page, GtkWidget *label=NULL)               {  return insert_page(page, 0, label);   }
+    gint prepend_page(GtkWidget *page, const gchar *label)                  {  return insert_page(page, 0, label);   }
+    gint append_page(GtkWidget *page, GtkWidget *label=NULL)                {  return insert_page(page, -1, label);  }
+    gint append_page(GtkWidget *page, const gchar *label)                   {  return insert_page(page, -1, label);  }
 
     void remove_page(gint n);
     void remove_page()                  {  remove_page (get_current_page());  }
@@ -73,11 +76,11 @@ struct GnomeCmdNotebook
 };
 
 
-inline gint GnomeCmdNotebook::insert_page(GtkWidget *page, gint n, const gchar *label)
+inline gint GnomeCmdNotebook::insert_page(GtkWidget *page, gint n, GtkWidget *label)
 {
     if (size()==1)
         gtk_notebook_set_show_tabs (*this, TRUE);
-    return gtk_notebook_insert_page (*this, page, label ? gtk_label_new (label) : NULL, n);
+    return gtk_notebook_insert_page (*this, page, label, n);
 }
 
 



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