gdaex_grid_init (GdaExGrid *gdaex_grid)
{
GdaExGridPrivate *priv = GDAEX_GRID_GET_PRIVATE (gdaex_grid);
+
+ priv->columns = g_ptr_array_new ();
}
GdaExGrid
return gdaex_grid;
}
+void
+gdaex_grid_add_column (GdaExGrid *grid, GdaExGridColumn *column)
+{
+ GdaExGridPrivate *priv;
+
+ g_return_if_fail (GDAEX_IS_GRID (grid));
+ g_return_if_fail (GDAEX_IS_GRID_COLUMN (column));
+
+ priv = GDAEX_GRID_GET_PRIVATE (grid);
+
+ g_ptr_array_add (priv->columns, g_memdup (column, sizeof (GdaExGridColumn)))
+}
+
+void
+gdaex_grid_add_columns (GdaExGrid *grid, GSList *columns)
+{
+ GSList *first;
+
+ g_return_if_fail (GDAEX_IS_GRID (grid));
+ g_return_if_fail (G_IS_SLIST (columns));
+
+ first = columns;
+ while (first != NULL)
+ {
+ gdaex_grid_add_column (grid, (GdaExGridColumn *)first->data);
+ first = g_slist_next (first);
+ }
+}
+
+void
+gdaex_grid_clear (GdaExGrid *grid)
+{
+ GdaExGridPrivate *priv;
+
+ guint col;
+
+ g_return_if_fail (GDAEX_IS_GRID (grid));
+
+ priv = GDAEX_GRID_GET_PRIVATE (grid);
+
+ for (col = 0; priv->columns->len; col++)
+ {
+ g_object_unref (g_ptr_array_index (priv->columns, col));
+ }
+
+ g_ptr_array_remove_range (priv->columns, 0, priv->columns->len);
+ g_ptr_array_unref (priv->columns);
+
+ priv->columns = g_ptr_array_new ();
+}
+
/* PRIVATE */
static void
gdaex_grid_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)