Re: libgoocanvasmm



I don't include Glib::Object, it complains about not being able to use gobject_

class Ellipse : public GooCanvas::ItemSimple
{
        _CLASS_GOBJECT(Ellipse,GooCanvasEllipse,GOO_CANVAS_ELLIPSE,Glib::Object,GObject)
        _IMPLEMENTS_INTERFACE(Item)

    public:

        explicit Ellipse(   const Glib::RefPtr<Item>& parent,
                            gdouble center_x = 0.0,
                            gdouble center_y = 0.0,
                            gdouble radius_x = 0.0,
                            gdouble radius_y = 0.0 ) ;


        _WRAP_PROPERTY("center-x",gdouble)
        _WRAP_PROPERTY("center-y",gdouble)
        _WRAP_PROPERTY("radius-x",gdouble)
        _WRAP_PROPERTY("radius-y",gdouble)

} ;


Has these methods that its generating:

Ellipse::Ellipse(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{}

Ellipse::Ellipse(GooCanvasEllipse* castitem)
:
  Glib::Object((GObject*)(castitem))
{}

Well, this isn't anything if not frustrating :D

Paul


On 9/27/06, Murray Cumming <murrayc murrayc com > wrote:

> This ought to be a quick one.
>
> class GooCanavs::ItemSimple inherits from Glib::Object
>
> class GooCanvas::Ellipse inherits from GooCanvas::ItemSimple and
> Glib::Object
[snip]

GooCanvasEllipse just inherits from GooCanvasItemSimple, which in turn
derives from Glib::Object. So you don''t need any multiple inheritance.

However, you do need multiple inhertiance when dealing with "interfaces":
Search for "implements" (such a G_IMPLEMENT_INTERFACE) in the .c files.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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