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

Re: narrowed down background color problem..



Hi,

I think the problem is occuring because you are modifying a Style that
is being used by all widgets. You need to duplicate the default style,
adjust it, and then associate it with the widget you wish to modify.
Here is some code I used in my prog:

  static GtkStyle *style;


  /* style stuff */
  style = gtk_style_copy(gtk_widget_get_style(widget));
  style->bg[GTK_STATE_PRELIGHT] = *my_color;

  gtk_widget_set_style(li, style);

and after the widget is destroyed do:

  gtk_style_unref(style);

In this code I was just trying to change the PRELIGHT colour of the
particular widget. Hope this helps.

David Bryant

"Scott." wrote:
> 
> just a recap: after adding a toggle button to my program, specifying the
> GTK_STATE_ACTIVATE style to have a red background, every widget created
> after that one has a red background...
> 
> it looks like setting the toggle_button's background will cause every
> aft-created widget to bring up the same red background...
> 
> is there a way to isolate specifying the red-background for only the
> toggle buttons, and have every widget created afterwards be of the default
> style?
> 
> thanx...
> 
> -=Scott
> 
> --
>          To unsubscribe: mail gtk-app-devel-list-request@redhat.com with
>                        "unsubscribe" as the Subject.
> 
>         Mailing list concerns should be mailed to <listmaster@redhat.com>

-- 
The sun's not yellow, it's chicken.



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