[gtk+/combo-refactor: 3/45] Added gtk_cell_view_new_with_context().
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/combo-refactor: 3/45] Added gtk_cell_view_new_with_context().
- Date: Sun, 5 Dec 2010 07:01:18 +0000 (UTC)
commit 04e46d145fa31e586c5ba0795655694e33f554e1
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Nov 18 15:21:41 2010 +0900
Added gtk_cell_view_new_with_context().
gtk/gtkcellview.c | 29 ++++++++++++++++++++++++++++-
gtk/gtkcellview.h | 4 ++++
2 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index d25f3da..e4e6d04 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -21,7 +21,6 @@
#include <string.h>
#include "gtkcellview.h"
#include "gtkcelllayout.h"
-#include "gtkcellareacontext.h"
#include "gtkcellareabox.h"
#include "gtkintl.h"
#include "gtkcellrenderertext.h"
@@ -667,6 +666,34 @@ gtk_cell_view_new (void)
return GTK_WIDGET (cellview);
}
+
+/**
+ * gtk_cell_view_new_with_context:
+ * @area: the #GtkCellArea to layout cells
+ * @context: the #GtkCellAreaContext in which to calculate cell geometry
+ *
+ * Creates a new #GtkCellView widget with a specific #GtkCellArea
+ * to layout cells and a specific #GtkCellAreaContext.
+ *
+ * Specifying the same context for a handfull of cells lets
+ * the underlying area synchronize the geometry for those cells,
+ * in this way alignments with cellviews for other rows are
+ * possible.
+ *
+ * Return value: A newly created #GtkCellView widget.
+ *
+ * Since: 2.6
+ */
+GtkWidget *
+gtk_cell_view_new_with_context (GtkCellArea *area,
+ GtkCellAreaContext *context)
+{
+ return (GtkWidget *)g_object_new (GTK_TYPE_CELL_VIEW,
+ "cell-area", area,
+ "cell-area-context", context,
+ NULL);
+}
+
/**
* gtk_cell_view_new_with_text:
* @text: the text to display in the cell view
diff --git a/gtk/gtkcellview.h b/gtk/gtkcellview.h
index 50feda7..7371082 100644
--- a/gtk/gtkcellview.h
+++ b/gtk/gtkcellview.h
@@ -26,6 +26,8 @@
#include <gtk/gtkwidget.h>
#include <gtk/gtkcellrenderer.h>
+#include <gtk/gtkcellarea.h>
+#include <gtk/gtkcellareacontext.h>
#include <gtk/gtktreemodel.h>
G_BEGIN_DECLS
@@ -62,6 +64,8 @@ struct _GtkCellViewClass
GType gtk_cell_view_get_type (void) G_GNUC_CONST;
GtkWidget *gtk_cell_view_new (void);
+GtkWidget *gtk_cell_view_new_with_context (GtkCellArea *area,
+ GtkCellAreaContext *context);
GtkWidget *gtk_cell_view_new_with_text (const gchar *text);
GtkWidget *gtk_cell_view_new_with_markup (const gchar *markup);
GtkWidget *gtk_cell_view_new_with_pixbuf (GdkPixbuf *pixbuf);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]