Problem with colors



Hi,
I've got a problem with the colors. When I draw objects in a window,
like lines, circles rectangles, text, I use for each object, a different
color, but after that, when any event is in the window, the color
changes. any suggestions?

here is the code to put the color,

(...)
  r->rcolor.red= 0xffff;
  r->rcolor.green= 0;
  r->rcolor.blue= 0xffff;
(...)
  gtk_widget_realize(app.window);
  app.gdkgc= gdk_gc_new(app.window->window);
  app.gdkcolormap= gdk_colormap_get_system();
(...)
void DibujarRectangulo(aplicacion_t *a, rectangulo_t *r)
{
  gdk_colormap_alloc_color(a->gdkcolormap, &r->rcolor, TRUE, TRUE);
  gdk_gc_set_foreground(a->gdkgc, &r->rcolor);
  gdk_gc_set_line_attributes(a->gdkgc,
			r->rgrosor,
			GDK_LINE_SOLID,
			GDK_CAP_BUTT,
			GDK_JOIN_MITER);
  gdk_draw_rectangle(a->drawingarea->window, a->gdkgc, FALSE, r->rx,
r->ry, r->ranchura, r->raltura);
  if (r->rfont == NULL)
    g_print("rfont is NULL\n");
  else
    gdk_draw_string (a->drawingarea->window, r->rfont, a->gdkgc, r->rx,
r->ry-5, r->rnombre);
}
(...)

thanks in advance,



ana.




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