Re: GObject Interface vs Pure Virtual Class

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

 



On Mon, 2007-05-14 at 12:12 -0700, Ana wrote:
> On Sat, May 12, 2007 at 02:42:50PM +0800, Kuang-Chun Cheng wrote:
> >    On 5/12/07, Jean Br*fort <[1]jean.brefort@xxxxxxxxxxxxxx> wrote:
> ....
> > 
> >      A GObject class can inherit from only one parent (which might be
> >      virtual), but you can add as many Interfaces as you like. It is somewhat
> >      similar to multiple inheritance in C++ (more like the D language
> >      actually).
> > 
> >    Hi Jean,
> > 
> >    That's new to me ... I did not catch up this from GObject Ref. Manual ...
> >    Thanks.
> > 
> >    KC
> 
> It's also important to note that GTK+ Interfaces cannot directly
> implement any functionality, unlike C++ classes.  They only specify the
> set of (rigid) "prototypes" that *must* be fully implemented by the
> implementing class.

This is wrong. Interface methods can have default implementations.

Look e.g. at:
http://svn.gnome.org/viewcvs/gimp/trunk/libgimpconfig/gimpconfig-iface.c?view=markup

ciao,
--mitch

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux