[gtk-list] Re: why not more code inheritance?



> 
> >  Why doesn't gtk make more use of code inheritance?  Seems to me that
> >  most invocations of *_realize are going to be 90% identical.  A quick
> >  grep and eyeball shows that to be true.  Why not move that code into
> >  the parent?  It would make the code easier to understand because the
> >  differences would be obvious.
> 
> *Shrug*  You could have a generic gtk_widget_generic_realize()
> function that you could simply use for your widget_class->realize.
> Most widget which want a single default window could use that.  The
> exotic widgets with more than one window can keep their existing
> realize methods.

MOst of the _realize code is the Window attribute settings (95%) + the
call to the window creation (1 line).

It's quite hard to make a generic function to do that, as the
window attribute structure is different for each window :(

Patrice.





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