Drawing on top of GnomeCanvas?



  I'm trying to do a very simple thing that is proving to be difficult.
I want to draw directly to the window of a GnomeCanvas. I have this
code:

static void canvas_realize(GtkWidget *widget)
{
        (...)
    self->xor_gc = gdk_gc_new(widget->window);
    gdk_gc_copy(self->xor_gc, widget->style->white_gc);
    gdk_gc_set_function(self->xor_gc, GDK_XOR);
}

Later, I draw a rectangle with:
    gdk_gc_set_line_attributes(gc, 3, self->line_style,                               
GDK_CAP_NOT_LAST,
                               GDK_JOIN_MITER);
    gdk_draw_rectangle(drawable, gc, FALSE, x, y, width, height);

  However, I can't see anything at all!
  My question is: does this look correct? shouldn't it work (I've done
this sort of thing in the past with GtkDrawingArea)? Or could it be that
GnomeCanvas does some magic to prevent direct drawing?
  
  Thanks in advance for any help.

-- 
Gustavo João Alves Marques Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>




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