RE: drawing lines (help please)



>     I'm finding it hard to find a simple example of drawing coloured
> lines. 
<snip> 
> My current code looks like this :-
> 
> gdk_draw_line(widget->window, widget->style->black_gc, x1, y1, x2, y2);

what you need has to deal with gc's (graphics context)

(see the gdk reference manual)

1. Create a GdkGC (say mygc)
2. Create and allocate a GdkColor
3. Assign it to the foreground

and use it like
gdk_draw_line(widget->window, mygc, x1, y1, x2, y2);

ciao

Hugues

NB: if it doesnt help you, tell me, I had code example, but not right now ;-)





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