How to implement Gtk::Orientable interface?



Hi all,


I have a class that derives from Glib::Object that should implement Gtk::Orientable. I thought it would be 
sufficient to just do:

class MyClass : public MyParentClass, ::Gtk::Orientable {
        public:
        MyClass() : Glib::ObjectBase(“MyClass"), MyParentClass(), Gtk::Orientable() {}
};

Even though this compiles without problems, I do get into trouble at runtime with errors like:

(test1:35777): GLib-GObject-WARNING **: attempting to add an interface (GtkOrientable) to class 
(gtkmm__CustomObject_MyClass) after class_init

(test1:35777): Gtk-CRITICAL **: gtk_orientable_get_orientation: assertion 'GTK_IS_ORIENTABLE (orientable)' 
failed

(test1:35777): Gtk-CRITICAL **: gtk_orientable_get_orientation: assertion 'GTK_IS_ORIENTABLE (orientable)' 
failed


I have tried changing the order of the parent constructors but that doesn’t seem to make a difference.

I would be very grateful for any help!

Thanks in advance and best regards,

Tom


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