0

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).

GTK 1.2.6 fanboy
  • 839
  • 1
  • 5
  • 20

1 Answers1

0

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

drahnr
  • 6,782
  • 5
  • 48
  • 75
  • Thanks for your answer, I agree that GtkCssProvider is probably the only way to achieve this (I forgot about this, since I haven't used it so far). I have to check if it is possible for toggle buttons inside a treeview, for "stand alone" toggle buttons this would probably be easier. – GTK 1.2.6 fanboy Aug 30 '13 at 07:47
  • The g_object_set is just a dirty way of overwriting some suported properties, the above should work for all widgets labeled/named `supercolorme` no matter where you place them. – drahnr Aug 30 '13 at 07:49