Re: Problem with the gc I use to draw

> >Hello ppl:
> >Problem with the gc I use to draw, it leaks to other widgets.
> >I have a Widget I use as a drawing area and 5 buttons I use to change
> >between drawing functions.
> >I am using these functions to draw on the Widget
> >
> >gdk_gc_set_line_attributes(widget->style->white_gc, lineWidth,
> > gdk_draw_line(pixmap1, widget->style->white_gc, x, y, x, y);
> >and the respective one for rects.
> >
> >and this function to refresh the drawing area:
> >gtk_widget_draw(widget, &update_rect);
> >
> >The drawing goes fine but after I draw if I go to the buttons these get
> >painted(as if the color leaked) in the color of the white_gc or black_gc
> >I am using to draw. Why is this?
> styles are shared resources. if you don't this effect, use
> gtk_style_copy() and gtk_widget_set_style() to get a per-widget style,
> and then modify the copy.

I tried using different styles for each widget but I still encountered the
same problem.

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