Harlow has some really exellent examples of how to do this in his book. You can download example code from the attached web site. Look for the example system monitor.
Sailboat racing is not a matter of life and death .... It is far more important than that !!!
Tom Aziz <tomazi caramail com> Sent by: gtk-app-devel-list-admin gnome org
04/21/01 10:18 AM
To: gtk-app-devel-list gnome org
cc:
Subject: GdkGC question
I don't succed to draw lines of different colors (and
style).
I need some help but it seems that nobody uses GDK drawing
features, and that there is no tutorial about this. It's
very sad because I want to use GDK for this, but if I can't
I will have to use another lib or another programming
langage with more documentation.
Maybe the problem is that I didn't really understand what a
GC is, and how it must be used.
gdk_gc_set_foreground(lines1_GC, color1);
/* same with color2 and lines2 */
}
--------------------
when an event (click) occurs, I use this function to draw
the line :
--- gdk_draw_line ---
gdk_draw_line(pixmap, lines1_GC,
x1, y1,
x2, y2);
/* or lines2 */
---------------------
The problem is : no matter what color I choose in
drawing_init, I get only the black
color. All of the code is in the same file.
How to draw lines of different colors ?
How to draw lines of different styles ?
Thanks for any help
Tomazi
______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com