Glib::Object and Gtk::Window multiple inheritance



Hi!

I want to create a base class for my window and dialog classes, the
structure looks lik this:

class Base : public Glib::Object
{
public:
	Base()
	: Glib::ObjectBase(typeid(Base))
	, p(*this, "p")
	{
	}

	Glib::Property<Glib::ustring> p;
};

class WindowBase : public Base, public Gtk::Window
{
public:
	WindowBase()
	:	Glib::ObjectBase(typeid(WindowBase))
	,	Base()
	,	Gtk::Window
	{
	}
};

class DialogBase : public Base, public Gtk::Dialog
{
public:
	DialogBase()
	: Glib::ObjectBase(typeid(DialogBase))
	, Base()
	, Gtk::Dialog
	{
	}
};

class MyWindow : public WindowBase
{
public:
	MyWindow()
	:	WindowBase()
	{
	}
};

When i want to instantiate the MyWindow, I get the following error:
glibmm:ERROR:objectbase.cc:78:void
Glib::ObjectBase::initialize(GObject*): assertion failed: (gobject_ ==
castitem)

I think it's because the multiple inheritance of Glib::Object from Base
and from Gtk::Window, but I can not find a solution.

Any help is appreciated:
Imre Horvath



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