- GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(klass);
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-printf("custom_list_class_init : deb\n");
- parent_class = g_type_class_peek_parent (klass);
-
- cell_class->render = custom_list_render;
- cell_class->get_size = custom_list_get_size;
- object_class->get_property = custom_list_get_property;
- object_class->set_property = custom_list_set_property;
- object_class->finalize = custom_list_finalize;
-
- // Install our very own properties
- g_object_class_install_property(object_class, PROP_PERCENTAGE, g_param_spec_double("percentage", "Percentage", "The fractional progress to display", 0.0, 1.0, 0.0, G_PARAM_READWRITE));
- g_object_class_install_property(object_class, PROP_THEME, g_param_spec_string("theme", "Theme", "Theme file name", NULL, G_PARAM_READWRITE));
- g_object_class_install_property(object_class, PROP_SNAPSHOT, g_param_spec_string("snapshot", "Snapshot", "Snapshot file name", NULL, G_PARAM_READWRITE));
-}
-
-
-// CustomList renderer initialisation
-static void custom_list_init(CustomList *custom_list)
-{
- printf("custom_list_init : deb\n");
- // set some default properties of the parent (GtkCellRenderer).
- GTK_CELL_RENDERER(custom_list)->mode = GTK_CELL_RENDERER_MODE_INERT;
- GTK_CELL_RENDERER(custom_list)->xpad = 2;
- GTK_CELL_RENDERER(custom_list)->ypad = 2;
-}
-
-
-static void custom_list_finalize(GObject *object)
-{
-/*
- CustomList *cellrendererprogress = CUSTOM_LIST(object);
-*/
-
-printf("custom_list_finalize\n");
- // Free any dynamically allocated resources here
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ GtkTreeViewColumn *col;
+ GtkCellRenderer *renderer;
+ GtkWidget *view;
+
+ g_store = gtk_list_store_new(NB_COL, G_TYPE_STRING, GDK_TYPE_PIXBUF);
+
+ view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(g_store));
+ gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
+ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
+
+ g_object_unref(g_store); // destroy store automatically with view
+
+ renderer = gtk_cell_renderer_text_new();
+ col = gtk_tree_view_column_new();
+ gtk_tree_view_column_pack_start(col, renderer, TRUE);
+ gtk_tree_view_column_add_attribute(col, renderer, "text", COL_THEME_FILE);
+ gtk_tree_view_column_set_visible(col, FALSE);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(view),col);
+
+ g_width_list = 200;
+ g_height_list = 30;
+ g_renderer = gtk_cell_renderer_pixbuf_new();
+ g_object_set(g_renderer, "xalign", 0.0, NULL);
+ gtk_cell_renderer_set_fixed_size(g_renderer, g_width_list, g_height_list);
+ // specific to gtk-2.18 or higher
+ //gtk_cell_renderer_set_padding(g_renderer, 5, 5);
+ col = gtk_tree_view_column_new();
+ gtk_tree_view_column_pack_start(col, g_renderer, TRUE);
+ gtk_tree_view_column_add_attribute(col, g_renderer, "pixbuf", COL_SNAPSHOT);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(view),col);
+
+ //g_timeout_add(50, (GSourceFunc) increase_timeout, NULL);
+
+ return view;