Re: Deriving from Gtk::CellEditable



Thanks for answer, Kjell.

Yes, I've been using gdb, and seen place of the error message. For now
there is no way to "override" property even using C code. One thing is
good - that happens only once, when my custom widget GType is
registered.

Well, actually, I am trying to port our business application from
GTKMM-2.4 (2.10.10) to GTKMM-3.0.

I have datetime widget - custom widget that I've derived from EventBox
and CellEditable. EventBox should catch events, and CellEditable
interface I've needed to create such widget in override for
CellRendererText::start_editing_vfunc.

Inside I've packed Entry (to edit datetime) and Button (to popup
calendar). I guess, I should redesign widget now, to use GTK-3.0 Entry
abilities, and derive direct from Entry widget.

But, I have to say, that it's not so good, that GTKMM-3.0 is not
supporting all features that GTK-3.0 brings now. It looks that there are
few places left in the GTKMM code that should be redesigned using new
GTK-3.0 features. I will be trying to do my best to find such places and
report it here during port of our business application.

Regards,

В Птн, 29/04/2011 в 17:25 +0200, Kjell Ahlstedt пишет:
> Hi Andrew,
> 
> I became curious, and tried to find an answer to your question.
> Unfortunately I failed. I doubt that interfaces in glibmm and gtkmm are
> meant to be used like you want to do, deriving directly from an
> interface without a corresponding C class that the derived C++ class
> wraps. It would be easier if you could derive your class from Gtk::Entry
> instead of directly from Gtk::CellEditable, but perhaps you have a good
> reason for not doing that?
> 
> If you use gdb for debugging, you can set a breakpoint at g_log, print a
> backtrace, and see from where the critical message is printed. You will
> see that it's printed while the constructor of Gtk::CellEditable is
> being executed. So, even if you can add the necessary code in your own
> constructor, it's too late. When it's reached, the message has already
> been printed.
> 
> ons 2011-04-27 klockan 12:42 +0400 skrev Andrew E. Makeev:
> > Hi
> > 
> > I am trying to implement custom class derived from Gtk::CellEditable
> > interface. When my object is creating I am getting GLIB critical:
> > 
> > GLib-GObject-CRITICAL **: Object class
> > gtkmm__CustomObject_N3Mgr8DateTimeE doesn't implement property
> > 'editing-canceled' from interface 'GtkCellEditable'
> > 
> > When I'm looked at the GTK/GTKMM sources I found that in GtkEntry for
> > instance there is such call:
> > 
> >   g_object_class_override_property (gobject_class,
> >                                     PROP_EDITING_CANCELED,
> >                                     "editing-canceled");
> > 
> > and I found no alternative for it in GTKMM.
> > 
> > How can I override property in my class derived from Gtk::CellEditable
> > interface?
> > 
> > thanks in advance,
> > 
> 
> 
-- 
Andrew E. Makeev <andrew solvo ru>
Solvo Logistic



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