[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: ANNOUNCE: gtkmm 2.91.7
From:       Tristan Van Berkom <tristanvb () openismus ! com>
Date:       2010-12-25 5:59:47
Message-ID: 1293256787.1684.17.camel () ragamuffin
[Download RAW message or body]

On Fri, 2010-12-24 at 14:58 +0100, Murray Cumming wrote:
> On Fri, 2010-12-24 at 13:14 +0100, Krzesimir Nowak wrote:
> > 2010/12/22 Murray Cumming <murrayc@murrayc.com>:
> > > On Wed, 2010-12-22 at 12:31 +0100, Murray Cumming wrote:
> > >> WARNING: TreeViews seems to be mostly empty in this version, but I'm releasing
> > >> this unstable version anyway. Maybe someone can discover what the problem is.
> > >
> > > This is not a problem with plain GTK+, so maybe something in gtkmm is
> > > causing it. Maybe some vfunc, for instance.
> > >
> > > I'm not likely to have much time over the next few weeks, so I'd
> > > appreciate any help in debugging this.
> > >
> > 
> > I have some suspicions about newly introduced cell stuff.
> > Especially a piece of code in gtkcelllayout.c beginning from line 133:
> > 
> > if (iface->pack_start)
> >   iface->pack_start (cell_layout, cell, expand);
> > else
> >   {
> >     area = iface->get_area (cell_layout);
> > 
> >     if (area)
> >       gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (area), cell, expand);
> >   }
> > 
> > The `if (iface->pack_start)' is true, because gtkmm puts there its own
> > function calling a C++ virtual method if possible. But none is called
> > when a type is not a derived one (here - Gtk::CellRendererText), so
> > it tries to call the original C vfunc. But this vfunc is NULL, so in the
> > end `iface->pack_start (cell_layout, cell, expand);' is a NOP. In that
> > case `else' part should be executed, but in C++ it isn't. This should
> > probably be fixed in C by giving GtkCellRendererText pack_start
> > vfunc a body in `else'. What do you think?
> 
> CCing Tristan, the author of that code, who might agree.
> 
> In general, yes, it is a bad idea for C GObjects to check if a vfunc is
> NULL. It should do default behaviour in a default implementation, not in
> the case that there is no default implementation. 
> 

Sure that sound's reasonable, we can achieve the same effect here by
doing this in default implementation.

Note that after all the refactoring work lands... all cell layouting
widgets (in GTK+ at least) only ever implement iface->get_area()
and only GtkCellArea implements the rest of the interface.

I'll put that change on my todo list... 

Cheers,
      -Tristan


_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic