summaryrefslogtreecommitdiff
path: root/tests/testtreefocus.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@imendio.com>2006-01-13 13:28:22 +0000
committerKristian Rietveld <kristian@src.gnome.org>2006-01-13 13:28:22 +0000
commit22870aa96db62fef10cbffafa4fc481af6bf381e (patch)
tree416289475276e67c1f4ffd544e9cabae4eee2af9 /tests/testtreefocus.c
parentce5e74e1fee1d8314c88b7f2f7a83670abadf667 (diff)
downloadgtk+-22870aa96db62fef10cbffafa4fc481af6bf381e.tar.gz
add a little test for the newly introduced indicator-size property.
2006-01-13 Kristian Rietveld <kris@imendio.com> * tests/testtreefocus.c (set_indicator_size), (main): add a little test for the newly introduced indicator-size property.
Diffstat (limited to 'tests/testtreefocus.c')
-rw-r--r--tests/testtreefocus.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/testtreefocus.c b/tests/testtreefocus.c
index 924e4f75c0..d4fb5f76ab 100644
--- a/tests/testtreefocus.c
+++ b/tests/testtreefocus.c
@@ -319,6 +319,23 @@ dave_toggled (GtkCellRendererToggle *cell,
gtk_tree_path_free (path);
}
+static void
+set_indicator_size (GtkTreeViewColumn *column,
+ GtkCellRenderer *cell,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ gint size;
+ GtkTreePath *path;
+
+ path = gtk_tree_model_get_path (model, iter);
+ size = gtk_tree_path_get_indices (path)[0] * 2 + 10;
+ gtk_tree_path_free (path);
+
+ g_object_set (cell, "indicator_size", size, NULL);
+}
+
int
main (int argc, char *argv[])
{
@@ -435,6 +452,7 @@ main (int argc, char *argv[])
"visible", VISIBLE_COLUMN,
NULL);
column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), col_offset - 1);
+ gtk_tree_view_column_set_cell_data_func (column, renderer, set_indicator_size, NULL, NULL);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);