Commit ee5ff7dd authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

changed new_with_types to just plain new, fixing the number of columns,

Fri Jun 29 22:13:28 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
	to just plain new, fixing the number of columns, and column types
	at creation time.

	* gtk/gtkliststore.c (gtk_list_store_new): ditto.

	* gtk/gtkcellrenderertext.c
	(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
	height to a specific font.

	* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.

	* tests/*c: change to work with new store models.
parent 49c1e6dc
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
Fri Jun 29 22:13:28 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_new): changed new_with_types
to just plain new, fixing the number of columns, and column types
at creation time.
* gtk/gtkliststore.c (gtk_list_store_new): ditto.
* gtk/gtkcellrenderertext.c
(gtk_cell_renderer_text_set_fixed_height_from_font): FIX the
height to a specific font.
* gtk/gtktreeview.c (gtk_tree_view_is_expander_column): fix brokenness.
* tests/*c: change to work with new store models.
2001-06-29 Havoc Pennington <hp@redhat.com>
* Throughout: fixes to compile with G_DISABLE_COMPAT
......
......@@ -680,7 +680,7 @@ create_tree (void)
GtkTreeIter iter;
gint i;
model = gtk_tree_store_new_with_types (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
......
......@@ -134,7 +134,7 @@ create_model (void)
GSList *ids;
GSList *tmp_list;
store = gtk_list_store_new_with_types (1, STOCK_ITEM_INFO_TYPE);
store = gtk_list_store_new (1, STOCK_ITEM_INFO_TYPE);
ids = gtk_stock_list_ids ();
ids = g_slist_sort (ids, (GCompareFunc) strcmp);
......
......@@ -40,6 +40,8 @@ enum {
PROP_YALIGN,
PROP_XPAD,
PROP_YPAD,
PROP_WIDTH,
PROP_HEIGHT,
};
......@@ -78,6 +80,8 @@ gtk_cell_renderer_init (GtkCellRenderer *cell)
cell->can_activate = FALSE;
cell->visible = TRUE;
cell->width = -1;
cell->height = -1;
cell->xalign = 0.5;
cell->yalign = 0.5;
cell->xpad = 0;
......@@ -156,6 +160,28 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
2,
G_PARAM_READABLE |
G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_WIDTH,
g_param_spec_int ("width",
_("width"),
_("The fixed width."),
-1,
100,
-1,
G_PARAM_READABLE |
G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_HEIGHT,
g_param_spec_int ("height",
_("height"),
_("The fixed height."),
-1,
100,
-1,
G_PARAM_READABLE |
G_PARAM_WRITABLE));
}
static void
......@@ -186,6 +212,12 @@ gtk_cell_renderer_get_property (GObject *object,
case PROP_YPAD:
g_value_set_uint (value, cell->ypad);
break;
case PROP_WIDTH:
g_value_set_int (value, cell->width);
break;
case PROP_HEIGHT:
g_value_set_int (value, cell->height);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
......@@ -227,6 +259,14 @@ gtk_cell_renderer_set_property (GObject *object,
cell->ypad = g_value_get_uint (value);
g_object_notify (object, "ypad");
break;
case PROP_WIDTH:
cell->width = g_value_get_int (value);
g_object_notify (object, "width");
break;
case PROP_HEIGHT:
cell->height = g_value_get_int (value);
g_object_notify (object, "height");
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
......@@ -257,10 +297,29 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
gint *width,
gint *height)
{
gint *real_width = NULL;
gint *real_height = NULL;
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
g_return_if_fail (GTK_CELL_RENDERER_GET_CLASS (cell)->get_size != NULL);
GTK_CELL_RENDERER_GET_CLASS (cell)->get_size (cell, widget, cell_area, x_offset, y_offset, width, height);
if (width)
{
if (cell->width == -1)
real_width = width;
else
*width = cell->width;
}
if (height)
{
if (cell->height == -1)
real_height = height;
else
*height = cell->height;
}
if (real_width || real_height)
GTK_CELL_RENDERER_GET_CLASS (cell)->get_size (cell, widget, cell_area, x_offset, y_offset, real_width, real_height);
}
/**
......@@ -353,3 +412,52 @@ gtk_cell_renderer_event (GtkCellRenderer *cell,
flags);
}
/**
* gtk_cell_renderer_set_fixed_size:
* @cell: A #GtkCellRenderer
* @width: the width of the cell renderer, or -1
* @height: the height of the cell renderer, or -1
*
* Sets the renderer size to be explicit, independent of the properties set.
**/
void
gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
g_return_if_fail (width >= -1 && height >= -1);
if (width != cell->width)
{
cell->width = width;
g_object_notify (G_OBJECT (cell), "width");
}
if (height != cell->height)
{
cell->height = height;
g_object_notify (G_OBJECT (cell), "height");
}
}
/**
* gtk_cell_renderer_get_fixed_size:
* @cell: A #GtkCellRenderer
* @width: location to fill in with the fixed width of the widget, or %NULL
* @height: location to fill in with the fixed height of the widget, or %NULL
*
* Fills in @width and @height with the appropriate size of @cell.
**/
void
gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
gint *width,
gint *height)
{
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
if (width)
(* width) = cell->width;
if (height)
(* height) = cell->height;
}
......@@ -51,14 +51,17 @@ struct _GtkCellRenderer
{
GtkObject parent;
gboolean can_activate;
gboolean visible;
gfloat xalign;
gfloat yalign;
gint width;
gint height;
guint16 xpad;
guint16 ypad;
guint can_activate : 1;
guint visible : 1;
};
struct _GtkCellRendererClass
......@@ -91,28 +94,35 @@ struct _GtkCellRendererClass
GtkCellRendererState flags);
};
GtkType gtk_cell_renderer_get_type (void);
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height);
void gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
GtkCellRendererState flags);
gboolean gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags);
GtkType gtk_cell_renderer_get_type (void);
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height);
void gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
GtkCellRendererState flags);
gboolean gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags);
void gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
gint width,
gint height);
void gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
gint *width,
gint *height);
#ifdef __cplusplus
}
......
......@@ -127,6 +127,8 @@ gtk_cell_renderer_text_init (GtkCellRendererText *celltext)
GTK_CELL_RENDERER (celltext)->yalign = 0.5;
GTK_CELL_RENDERER (celltext)->xpad = 2;
GTK_CELL_RENDERER (celltext)->ypad = 2;
celltext->fixed_height_rows = -1;
}
static void
......@@ -785,11 +787,15 @@ gtk_cell_renderer_text_set_property (GObject *object,
if (font_desc)
pango_font_description_free (font_desc);
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
}
break;
case PROP_FONT_DESC:
set_font_description (celltext, g_value_get_boxed (value));
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_FAMILY:
......@@ -801,6 +807,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "family_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_STYLE:
......@@ -810,6 +818,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "style_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_VARIANT:
......@@ -819,6 +829,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "variant_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_WEIGHT:
......@@ -828,6 +840,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "weight_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_STRETCH:
......@@ -837,6 +851,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "stretch_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_SIZE:
......@@ -846,11 +862,15 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "size_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_SCALE:
celltext->font_scale = g_value_get_double (value);
celltext->scale_set = TRUE;
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_SIZE_POINTS:
......@@ -860,6 +880,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_notify (G_OBJECT (celltext), "size_set");
g_object_notify (G_OBJECT (celltext), "font_desc");
g_object_notify (G_OBJECT (celltext), "font");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_EDITABLE:
......@@ -885,6 +907,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
celltext->rise = g_value_get_int (value);
celltext->rise_set = TRUE;
g_object_notify (G_OBJECT (celltext), "rise_set");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
case PROP_BACKGROUND_SET:
......@@ -1083,20 +1107,54 @@ gtk_cell_renderer_text_get_size (GtkCellRenderer *cell,
gint *width,
gint *height)
{
GtkCellRendererText *celltext = (GtkCellRendererText *)cell;
GtkCellRendererText *celltext = (GtkCellRendererText *) cell;
PangoRectangle rect;
PangoLayout *layout;
if (celltext->fixed_size)
if (celltext->calc_fixed_height)
{
if (width)
*width = celltext->width;
if (height)
*height = celltext->height;
PangoContext *context;
PangoFontMetrics metrics;
PangoFontDescription font_desc;
font_desc = (* widget->style->font_desc);
if (celltext->family_set &&
celltext->font.family_name)
font_desc.family_name = celltext->font.family_name;
if (celltext->style_set)
font_desc.style = celltext->font.style;
return;
if (celltext->variant_set)
font_desc.variant = celltext->font.variant;
if (celltext->weight_set)
font_desc.weight = celltext->font.weight;
if (celltext->stretch_set)
font_desc.stretch = celltext->font.stretch;
if (celltext->size_set &&
celltext->font.size >= 0)
font_desc.size = celltext->font.size;
context = gtk_widget_get_pango_context (widget);
pango_context_get_metrics (context,
&font_desc,
pango_context_get_language (context),
&metrics);
gtk_cell_renderer_set_fixed_size (cell,
cell->width, 2*cell->ypad +
celltext->fixed_height_rows*(metrics.ascent + metrics.descent)/PANGO_SCALE);
if (height)
{
*height = cell->height;
height = NULL;
}
celltext->calc_fixed_height = FALSE;
if (width == NULL)
return;
}
layout = get_layout (celltext, widget, FALSE, 0);
pango_layout_get_pixel_extents (layout, NULL, &rect);
......@@ -1187,29 +1245,33 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
}
/**
* gtk_cell_renderer_text_set_fixed_size:
* gtk_cell_renderer_text_set_fixed_height_from_font:
* @renderer: A #GtkCellRendererText
* @fixed_size: TRUE if the renderer should be a fixed height.
* @width: The width of the cell
* @height: The height it of the cell, or -1
* @number_of_rows: Number of rows of text each cell renderer is allocated, or -1
*
* Sets the height of a renderer to explicitly be a certain size. This
* function is unflexible, and should really only be used if calculating the
* size of a cell is too slow.
* Sets the height of a renderer to explicitly be determined by the "font" and
* "y_pad" property set on it. Further changes in these properties do not
* affect the height, so they must be accompanied by a subsequent call to this
* function. Using this function is unflexible, and should really only be used
* if calculating the size of a cell is too slow. If @no_rows is -1, then the
* fixed height is unset, and the height is determined by the properties again.
**/
void
gtk_cell_renderer_text_set_fixed_size (GtkCellRendererText *renderer,
gboolean fixed_size,
gint width,
gint height)
gtk_cell_renderer_text_set_fixed_height_from_font (GtkCellRendererText *renderer,
gint number_of_rows)
{
g_return_if_fail (GTK_IS_CELL_RENDERER_TEXT (renderer));
g_return_if_fail (number_of_rows == -1 || number_of_rows > 0);
if (renderer->fixed_size == (fixed_size)?TRUE:FALSE)
return;
renderer->fixed_size = (fixed_size)?TRUE:FALSE;
renderer->height = height;
renderer->width = width;
if (number_of_rows == -1)
{
gtk_cell_renderer_set_fixed_size (GTK_CELL_RENDERER (renderer),
GTK_CELL_RENDERER (renderer)->width,
-1);
}
else
{
renderer->fixed_height_rows = number_of_rows;
renderer->calc_fixed_height = TRUE;
}
}
......@@ -54,10 +54,8 @@ struct _GtkCellRendererText
PangoUnderline underline_style;
gint rise;
gint width;
gint height;
gint fixed_height_rows;
guint fixed_size : 1;
guint strikethrough : 1;
/* editable feature doesn't work */
......@@ -83,6 +81,7 @@ struct _GtkCellRendererText
guint strikethrough_set : 1;
guint editable_set : 1;
guint calc_fixed_height : 1;
};
struct _GtkCellRendererTextClass
......@@ -90,13 +89,11 @@ struct _GtkCellRendererTextClass
GtkCellRendererClass parent_class;
};
GtkType gtk_cell_renderer_text_get_type (void);
GtkCellRenderer *gtk_cell_renderer_text_new (void);
GtkType gtk_cell_renderer_text_get_type (void);
GtkCellRenderer *gtk_cell_renderer_text_new (void);
void gtk_cell_renderer_text_set_fixed_size (GtkCellRendererText *renderer,
gboolean fixed_size,
gint width,
gint height);
void gtk_cell_renderer_text_set_fixed_height_from_font (GtkCellRendererText *renderer,
gint number_of_rows);
#ifdef __cplusplus
......
......@@ -65,6 +65,13 @@ static gboolean gtk_list_store_iter_parent (GtkTreeModel *tree_mode
GtkTreeIter *child);
static void gtk_list_store_set_n_columns (GtkListStore *list_store,
gint n_columns);
static void gtk_list_store_set_column_type (GtkListStore *list_store,
gint column,
GType type);
/* Drag and Drop */
static gboolean gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source,
GtkTreePath *path);
......@@ -235,38 +242,18 @@ gtk_list_store_init (GtkListStore *list_store)
/**
* gtk_list_store_new:
*
* Creates a new #GtkListStore. A #GtkListStore implements the
* #GtkTreeModel interface, and stores a linked list of
* rows; each row can have any number of columns. Columns are of uniform type,
* i.e. all cells in a column have the same type such as #G_TYPE_STRING or
* #GDK_TYPE_PIXBUF. Use #GtkListStore to store data to be displayed in a
* #GtkTreeView.
*
* Return value: a new #GtkListStore
**/
GtkListStore *
gtk_list_store_new (void)
{
return GTK_LIST_STORE (g_object_new (gtk_list_store_get_type (), NULL));
}
/**
* gtk_list_store_new_with_types:
* @n_columns: number of columns in the list store
* @Varargs: all #GType types for the columns, from first to last
*
* Creates a new list store as with gtk_list_store_new(), simultaneously setting
* up the columns and column types as with gtk_list_store_set_n_columns() and
* gtk_list_store_set_column_type(). As an example,
* gtk_tree_store_new_with_types (3, G_TYPE_INT, G_TYPE_STRING,
* GTK_TYPE_PIXBUF); will create a new GtkListStore with three columns, of type
* int, string and GtkPixbuf respectively.
* Creates a new list store as with @n_columns columns each of the types passed
* in. As an example, gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING,
* GDK_TYPE_PIXBUF); will create a new GtkListStore with three columns, of type
* int, string and GDkPixbuf respectively.
*
* Return value: a new #GtkListStore
**/
GtkListStore *
gtk_list_store_new_with_types (gint n_columns,
gtk_list_store_new (gint n_columns,
...)
{
GtkListStore *retval;
......@@ -275,7 +262,7 @@ gtk_list_store_new_with_types (gint n_columns,
g_return_val_if_fail (n_columns > 0, NULL);
retval = gtk_list_store_new ();
retval = GTK_LIST_STORE (g_object_new (gtk_list_store_get_type (), NULL));
gtk_list_store_set_n_columns (retval, n_columns);
va_start (args, n_columns);
......@@ -298,15 +285,7 @@ gtk_list_store_new_with_types (gint n_columns,
return retval;
}
/**
* gtk_list_store_set_n_columns:
* @store: a #GtkListStore
* @n_columns: number of columns
*
* Sets the number of columns in the #GtkListStore.
*
**/
void
static void
gtk_list_store_set_n_columns (GtkListStore *list_store,
gint n_columns)
{
......@@ -340,19 +319,7 @@ gtk_list_store_set_n_columns (GtkListStore *list_store,
list_store->n_columns = n_columns;
}
/**
* gtk_list_store_set_column_type:
* @store: a #GtkListStore
* @column: column number
* @type: type of the data stored in @column
*
* Supported types include: %G_TYPE_UINT, %G_TYPE_INT, %G_TYPE_UCHAR,
* %G_TYPE_CHAR, %G_TYPE_BOOLEAN, %G_TYPE_POINTER, %G_TYPE_FLOAT,
* %G_TYPE_DOUBLE, %G_TYPE_STRING, %G_TYPE_OBJECT, and %G_TYPE_BOXED, along with
* subclasses of those types such as %GDK_TYPE_PIXBUF.
*
**/
void
static void
gtk_list_store_set_column_type (GtkListStore *list_store,
gint column,
GType type)
......