Re: color of gtk widget
- From: jcupitt gmail com
- To: "Prasanna Kumar K" <prasanna tataelxsi co in>
- Cc: gtk-devel-list gnome org
- Subject: Re: color of gtk widget
- Date: Fri, 3 Aug 2007 16:17:00 +0100
On 8/3/07, Prasanna Kumar K <prasanna tataelxsi co in> wrote:
> I have a GtkWidget "Button. I want the color of the button should be complete red.
You can do it with a gtkrc. For example, set this resource file:
--
style "red_style" = "default"
{
bg[NORMAL] = "#C1665A"
bg[PRELIGHT] = "#E0B6AF"
bg[ACTIVE] = "#C1665A"
bg[SELECTED] = "#C1665A"
bg[INSENSITIVE] = "#884631"
}
widget "*red_widget" style "red_style"
--
Now in your code do:
void
set_name( GtkWidget *widget, const char *name )
{
gtk_widget_set_name( widget, name );
if( GTK_IS_CONTAINER( widget ) )
gtk_container_foreach( GTK_CONTAINER( widget ),
(GtkCallback) set_name, (char *) name );
}
set_name( button, "red_widget" );
And the button (and any widgets inside the button) should turn red.
No doubt there's a better technique :-(
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]