Re: How to change GtkEntry background

Hi, you could try this:
on_button1_clicked    (GtkButton   *button,  gpointer   user_data)
  GtkStyle *style;
  GtkStyle *oldstyle;
  GdkColor color;
  GdkColor color2;;;;;;;

  oldstyle = gtk_widget_get_default_style();
  style = gtk_style_copy(oldstyle);
  style->bg[GTK_STATE_NORMAL] =color;
  style->bg[GTK_STATE_ACTIVE] =color2; 

i do that to set a button's background color in a my own button class .
try to do that.

> I want to display some data in an array of Entry widgets, and I'd like
> to change the text background on a per-widget basis to represent a few
> bits of other data associated with each entry.  Is it possible?  I can
> only get a single-pixel-width line around the border to change colour,
> which is not very helpful.
> The colours have to change whenever the content changes.
> [What I'd _like_ to be able to do is something like
>   gtk_widget_set_named_style(my_widget, "foo")
> to make the widget use a style "foo" defined in an rc file]
> -- 
> Quid enim est stultius quam incerta pro certis habere, falsa pro 
>                                                                  -- 
> (setq reply-to
>   (concatenate 'string "Paul 
Foley " "<mycroft" '(#\@) ">"))
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org

Isaac Pernas Sánchez
Ingeniería Industrial
100014098 alumnos uc3m es

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