Re: setting background color to drawing area



    Billy> I've been looking throught the archived mail but havent found
    Billy> anything but discussions about doing this.  I'm just on my 2nd day
    Billy> with gtk and need some assistance.

Setting it is easy.  Changing it a lot seems to be trickier.  Anyway:

  GdkColor newbg;
  GtkStyle *style;

  style = gtk_style_copy(gtk_widget_get_style(widget));
  style->bg[GTK_STATE_NORMAL] = newbg;
  gtk_widget_set_style(widget, style);

You have get the color you want by using the GDK color routines first.

Also, I'm not sure if the copied style needs to be ref'ed or unref'ed.
Haven't looked at it in any detail.
-----------------------------------------------------------------------------
Mark Leisher
Computing Research Lab            Cinema, radio, television, magazines are a
New Mexico State University       school of inattention: people look without
Box 30001, Dept. 3CRL             seeing, listen without hearing.
Las Cruces, NM  88003                            -- Robert Bresson




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