1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
//==========================================================================================
// Fonction callback permettant de redessiner les couleurs des cellules
// suivant divers critères
// Cette fonction est exécuter à chaque fois que les cellules doivent être redessinées.
// (dessin initial, survole, utilisation de l'ascenseur, etc ...)
//==========================================================================================
void paint_cell_func(GtkTreeViewColumn *column,
GtkCellRenderer *renderer,
GtkTreeModel *model, // p_liststore1
GtkTreeIter *iter,
gpointer user_data)
{
gint ident;
gint no_token;
gchar *lib;
gint nb_good;
gint nb_bad;
gint row;
gtk_tree_model_get(model, iter, 0, &ident, 1, &no_token, 2, &lib, 3, &nb_good, 4, &nb_bad, -1);
if (ident%2 == 1) {
g_object_set(renderer, "background", "cyan", "background-set", TRUE, NULL);
} else {
g_object_set(renderer, "background", "lightcyan", "background-set", TRUE, NULL);
}
} |
Partager