{
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (vcolumn));
cells = g_list_first (cells);
- gtk_tree_view_column_add_attribute (vcolumn, (GtkCellRenderer *)cells->data, "text", col);
+
+ if (gdaex_grid_column_get_gtype (gcolumn) == G_TYPE_BOOLEAN)
+ {
+ gtk_tree_view_column_add_attribute (vcolumn, (GtkCellRenderer *)cells->data, "active", col);
+ }
+ else
+ {
+ gtk_tree_view_column_add_attribute (vcolumn, (GtkCellRenderer *)cells->data, "text", col);
+ }
gtk_tree_view_append_column (GTK_TREE_VIEW (view), vcolumn);
}
}
gtk_cell_renderer_set_alignment (renderer, 1.0, 0.5);
}
+ else if (priv->type == G_TYPE_BOOLEAN)
+ {
+ renderer = gtk_cell_renderer_toggle_new ();
+ gtk_cell_renderer_set_alignment (renderer, 0.5, 0.5);
+ }
else
{
g_warning ("Error on creating the renderer for column «%s».", priv->title);
gcol = gdaex_grid_column_new ("Incoming", "incoming", G_TYPE_DOUBLE, TRUE, TRUE, TRUE, TRUE, 2);
gdaex_grid_add_column (grid, gcol);
+ gcol = gdaex_grid_column_new ("Married", "married", G_TYPE_BOOLEAN, TRUE, TRUE, TRUE, TRUE, -1);
+ gdaex_grid_add_column (grid, gcol);
+
wgrid = gdaex_grid_get_widget (grid);
gtk_container_add (GTK_CONTAINER (scrolledw), wgrid);