How to get the used style for a widget



Hi,

how can I get the style which is actually used to draw the widgets in
an application? More preciously, I need to get the foreground colour
(resp. the colours for the GtkStateType enum) for a widget.
I want to change the foreground colour of this widget(GtkLabel) to red
if a file inside my application has changed and reset the colour to the
default foreground colour if the file was saved.
I tried gtk_widget_get_default_style() and gtk_widget_get_style() but
the returned style doesn't seemed to be used to draw any widgets.

I tried it with the following ~/.gtkrc-2.0:
style "my_style"
{
    fg[ACTIVE]        = "#008918"
    fg[NORMAL]        = "#008918"
}
widget_class "*" style "my_style"

This works, so I get all green menu items, notebook tabs and so on.
Now, I need a way to get these values for fg[ACTIVE] and fg[NORMAL] in
GTK.

Any ideas?

Regards,
Enrico

--
Get my GPG key from http://www.uvena.de/pub.key


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]