Setting colour for insensitive text



Hi folks, I have little problems setting colours for insensitive text in GTK entries. It used to work well with GTK+2, but with GTK+3 my choices seem to be ignored.
Here is a Vala sample to demonstrate the problem :
http://www.tarnyko.net/repo/testgtk-insensitive_text.vala The important part is :
Gdk.Color insensitive_color = Gdk.Color ();
Gdk.Color.parse ("red", out insensitive_color);
[...]
entry.set_sensitive (false);
entry.modify_text (StateType.INSENSITIVE, insensitive_color);
I first instantiate a "Gdk.Color" object and parse the "red" colour in it.
Then I make my Entry insensitive, and associate insensitive text therein with my Color object.
WORKS with GTK+2 :
valac --pkg gtk+-2.0 testgtk-insensitive_text.vala
DOESN'T WORK with GTK+3 :
valac --pkg gtk+-3.0 testgtk-insensitive_text.vala Text is red in GTK+2, stays gray in GTK+3. Could someone give me a direction ?
PS : I want to avoid using CSS if possible.


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