GtkCellRendererToggle - color of toggle button inside treeview

484 views Asked by At

I have a treeview that uses GtkCellRendererToggle to display toggle buttons inside cells. My question: Is is possible to set the color just for the toggle button there? I only know how to set the cell background, which is done like this:

g_object_set (toggle-renderer, "cell-background", 
              "anycolouryoulike", "cell-background-set", TRUE, NULL);

GtkCellRenderer features only cell background properties, I wonder if there is nethertheless a way to do it? (I use C, but if there is a way, an example in any language would do).

1

There are 1 answers

2
drahnr On

GtkCssProvider might help, just try to style buttons within GtkCssProvider (list of suported properties per widget , not necessary for this case)

You could use something like

#supercolorme {
    color: #ffed00;
}

and name your widgets supercolorme by using void gtk_widget_set_name (GtkWidget *widget, const gchar *name); as described in the gtk+ API docs