subclassing textitem



Dear Damon, dear list,

I try to create a new canvas item which is subclassed from
goocanvastext. This new type implements amongst other things the paint
and is_item_at methods. What I want to do is that I reuse the methods
from the parent class. For example in the paint method, I want first
to use the paint from goocanvastext, and then I use the cr to paint
some extra things. But how can I access the parents methods? I have
unsuccessfully tried things like this:

my_text_paint (GooCanvasItemSimple   *simple,
                      cairo_t *cr,
                      const GooCanvasBounds *bounds)
{

  GooCanvasTextClass *text_class = GOO_CANVAS_TEXT_GET_CLASS(text);
  //text_class->goo_canvas_text_paint(simple,cr,bounds); /* does not compile */
  text_class->paint(simple,cr,bounds); /* does not compile either */
  ...
  paint_something_extra(cr);
}


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