Re: How to change colors on a drawing area?
- From: "tony K." <tony kwok 3web net>
- To: gtk-app-devel-list gnome org
- Subject: Re: How to change colors on a drawing area?
- Date: Fri, 23 Feb 2001 09:07:04 -0700
At 12:10 23-02-01 +0100, you wrote:
How to write a blue line and then a red line using gtk_draw_line?
Thanks
Luciano
By drawing with an appropirately set graphical context. 
I include here a few sample lines; THIS IS NOT a
complete code sequence, just a sample "invetory" of 
calls, but it should be all you need:
  gc = gdk_gc_new(mydraw->window);
...
   colormap = gdk_colormap_get_system();
   myColor.red = SOME_COL_R;
   myColor.green = SOME_COL_G;
   myColor.blue = SOME_COL_B;
   gdk_color_alloc(colormap, &myColor);
...
  gdk_draw_line(mydraw, gc, x1, y1, x2, y1);
  ...
   gdk_gc_unref(gc);
cheers, TK
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]