[gtk+/treeview-refactor] Adding gtk_tree_view_column_new_with_area().



commit 55bbe4a3a55090766ae81182e8d545db792f5d59
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Mon Dec 6 19:04:51 2010 +0900

    Adding gtk_tree_view_column_new_with_area().
    
    Creates a treeviewcolumn using a specific GtkCellArea.
    This patch also makes GtkEntryCompletion use the new api
    instead of g_object_new().

 gtk/gtkentrycompletion.c |    2 +-
 gtk/gtktreeviewcolumn.c  |   21 +++++++++++++++++++++
 gtk/gtktreeviewcolumn.h  |    1 +
 3 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 8d21b64..36247dd 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -493,7 +493,7 @@ gtk_entry_completion_constructor (GType                    type,
                     completion);
   priv->first_sel_changed = TRUE;
 
-  priv->column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, "cell-area", priv->cell_area, NULL);
+  priv->column = gtk_tree_view_column_new_with_area (priv->cell_area);
   gtk_tree_view_append_column (GTK_TREE_VIEW (priv->tree_view), priv->column);
 
   priv->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 02e4652..c054a6b 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -1530,6 +1530,27 @@ gtk_tree_view_column_new (void)
 }
 
 /**
+ * gtk_tree_view_column_new_with_area:
+ * @area: the #GtkCellArea that the newly created column should use to layout cells.
+ * 
+ * Creates a new #GtkTreeViewColumn using @area to render it's cells.
+ * 
+ * Return value: A newly created #GtkTreeViewColumn.
+ *
+ * Since: 3.0
+ */
+GtkTreeViewColumn *
+gtk_tree_view_column_new_with_area (GtkCellArea *area)
+{
+  GtkTreeViewColumn *tree_column;
+
+  tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, "cell-area", area, NULL);
+
+  return tree_column;
+}
+
+
+/**
  * gtk_tree_view_column_new_with_attributes:
  * @title: The title to set the header to.
  * @cell: The #GtkCellRenderer.
diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h
index c056898..f964177 100644
--- a/gtk/gtktreeviewcolumn.h
+++ b/gtk/gtktreeviewcolumn.h
@@ -105,6 +105,7 @@ struct _GtkTreeViewColumnClass
 
 GType                   gtk_tree_view_column_get_type            (void) G_GNUC_CONST;
 GtkTreeViewColumn      *gtk_tree_view_column_new                 (void);
+GtkTreeViewColumn      *gtk_tree_view_column_new_with_area       (GtkCellArea             *area);
 GtkTreeViewColumn      *gtk_tree_view_column_new_with_attributes (const gchar             *title,
 								  GtkCellRenderer         *cell,
 								  ...) G_GNUC_NULL_TERMINATED;



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