Gtk, Trying to set GtkLabel text color (gtkrc).
Posted
by PP
on Stack Overflow
See other posts from Stack Overflow
or by PP
Published on 2010-04-15T06:50:26Z
Indexed on
2010/04/15
6:53 UTC
Read the original article
Hit count: 338
Hi all,
I have written one small gtkrc file and I am trying to set Text color for GtkLabel, but it is not working out following is the rc file.
style "my-theme-label"
{
xthickness = 10
ythickness = 10
bg[NORMAL] = "#ffffff"
bg[ACTIVE] = "#ffffff"
bg[PRELIGHT] = "#ffffff"
bg[SELECTED] = "#ffffff"
bg[INSENSITIVE] = "#ffffff"
fg[NORMAL] = "#ffffff"
fg[INSENSITIVE] = "#ffffff"
fg[PRELIGHT] = "#ffffff"
fg[SELECTED] = "#ffffff"
fg[ACTIVE] = "#ffffff"
text[NORMAL] = "#ffffff"
text[INSENSITIVE] = "#434346"
text[PRELIGHT] = "#ffffff"
text[SELECTED] = "#ffffff"
text[ACTIVE] = "#ffffff"
base[NORMAL] = "#000000"
base[INSENSITIVE] = "#00ff00"
base[PRELIGHT] = "#0000ff"
base[SELECTED] = "#ff00ff"
base[ACTIVE] = "#f39638"
}
widget_class "*<GtkLabel>" style "my-theme-label"
My application uses 2 rc files and I have added my rc file using gtk_rc_add_default_file( rcfile );
but this style is not getting set to GtkLabel.
Also i tried to create different style for same type of widgets. as follows but in some cases it works and in some it does not work.
style "my-button-style-black"
{
...
}
style "my-button-style-white"
{
...
}
widget "*.MyWhiteButton" style "my-button-style-white"
widget "*.MyBlackButton" style "my-button-style-black"
GtkButton *button = gtk_button_new_with_label("Test");
gtk_widget_set_name(button, "MyWhiteButton");
Is it right? It is not working out.
Is it because I am using 2 rc files?
Thanks,
PP.
© Stack Overflow or respective owner