Re: color gradients in windows?



Gary Scavone <gary ccrma stanford edu> writes:
> I've looked through some of the documentation but I haven't been able
> to figure out whether it is possible to have gtk windows with
> background color gradients.  For example, I wrote a gtk program for
> psychoacoustic tests that lets the user move items (buttons) around in
> a gtk_layout widget.  We'd now like to define regions within the
> gtk_layout widget by having different background colors.  Is that
> currently possible?
> 

Just draw rectangles in the layout. See the "scribble" example in the
tutorial; that uses a drawing area. Layout is the same, except you
draw to layout->bin_window rather than widget->window, and scrolling 
will set layout->xoffset/layout->yoffset, and you want to offset your
drawing by that amount.

(layout->xoffset, layout->yoffset are IIRC the position of the
bin_window in layout coordinates, where layout coordinates are what
you position child widgets in; so this defines how to offset the
layout coordinates when you call gdk_draw_* on the bin window.)

Havoc




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