[Vala] Need for an example of creating new item



Hi everyone

I am trying to use the goocanvas binding. But I don't know how to
create a new item by subclassing CanvasItemSimple.

I tried a basic testing by defining:

class Handler: Goo.CanvasItemSimple {
public override bool simple_is_item_at (double x, double y,
    Cairo.Context cr, bool is_pointer_event){ return true; } 
public override void simple_paint (Cairo.Context cr, 
    Goo.CanvasBounds bounds){} 
public override void simple_update (Cairo.Context cr){}
}

based on the goocanvas.vapi

At compilation time I got:

go.vala:4.1-4.35: warning: unable to chain up to private base
constructor class Handler: Goo.CanvasItemSimple, Goo.CanvasItem {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/nico/progs/goo/go.vala.c: In function ‘handler_class_init’:
/home/nico/progs/goo/go.vala.c:93: attention : assignment from
incompatible pointer type Compilation succeeded - 1 warning(s)

What does that means?

And how should I construct my Handler item?

Does anyone has an example/a snippet/a source code/or anything else that
could help me (I googled a lot but I can't find anything)?

Thanks 

PS: By the way, thanks to all the dev of vala.

-- 
Nicolas



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