Gtk::Widget as virtual base



I want to use an abstract class derived from Gtk::Widget and then
derive different classes which use particular widgets to display themselves.

That is, I want to do something like

class vwidget: public virtual Gtk::Widget
{
 public:
  virtual void magic()=0;
};

class mywidget: public vwidget, public Gtk::HBox
{
 public:
  void magic() {x=1;}
 private:
  int x;
};

mywidget m;

But when I compile this I get the following errors:
document.h:86: error: no unique final overrider for `virtual void Glib::ObjectBase::destroy_notify_()' in `mywidget'
document.h:86: error: no unique final overrider for `virtual void Glib::ObjectBase::set_manage()' in `mywidget'
document.h:86: error: no unique final overrider for `virtual void Glib::ObjectBase::destroy_notify_()' in `mywidget'
document.h:86: error: no unique final overrider for `virtual void Glib::ObjectBase::set_manage()' in `mywidget'

I am using gtkmm 2.4 and g++ 3.4.2

Not making Gtk::Widget virtual in the definition of vwidget leads to the same errors and
I don't think that would solve my problem anyway.

I would be grateful if the subscribers of this list can suggest a way out of my problem.

--Jyotirmoy


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