Re: [gtk-list] GdkGC and Color question

Michael Lausch <> writes:

> The problem i have is with styles, graphic contexts and color.
> (Yes the widget is currently displaying all the desktops and windows,
> means it works somehow).
> How do i draw rectangles with arbitrary fill colors and border
> colors? the window having the focus should be displyed in white with a 
> black border. I currently messing around with gdk_gc_gc() and
> gdk_gc_set_foreground.

This sounds like the right thing to do.
> The question is: what is style->bg_gc[winstate]? I assume it's the
> background style. But why does the background style have a foreground
> and a background color? Which color is used with gdk_draw_rectangle
> for filling and which one for the border?

style->XXX_gc[winstate] is a graphics context with the
foreground color set to the style color style->XXX.
The background color of a graphics context is not used for
much. Off the top of my head, it is used for the second color
when drawing dashed lines, and the background color for
XDrawImageString (which is not wrapped in GDK). 

The GC's foreground value will (I think) be used for both the
border and the fill of the rectangle. So if you want them different
colors, you'll need two separate calls, one with fill set to
TRUE, one with fill set to FALSE.


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