Setting a line color
- From: Bryan Brown <bbrown saltmine radix net>
- To: gtk-app-devel-list gnome org
- Subject: Setting a line color
- Date: Mon, 30 Sep 2002 09:27:03 -0400 (EDT)
I've got the code working to draw lines on a drawing area based on mouse
motion, and now I'd like to set the line color before drawing the line.
The snippet of code at
http://www.radix.net/~bbrown/set_color.c
shows what I've tried.
When a mouse button is pressed the code calls gdk_gc_get_values to get the
current GdkGCValues, then builds the GdkColor I want and calls
gdk_gc_set_foreground to set the pen color. When the mouse button is
released it calls gdk_gc_set_foreground to reset the foreground color to
the saved GdkGCValues foreground color.
The problem is, the line color is still black instead of the orange in my
test. What am I not doing?
I wasn't sure what to specify for the GdkColor.pixel value, so I tried
setting it to NULL and also not setting it at all, but neither worked.
Thanks,
Bryan
*---------------------------------------------------------------
* Bryan Brown <*> bbrown radix net
* http://www.radix.net/~bbrown
*---------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]