[Gtk-sharp-list] GInterface implementation

Rachel Hestilow lists@nullenvoid.com
Fri, 16 Apr 2004 12:25:46 -1000

Essentially the problem is the same as with non-signal virtual methods 
-- there is no easy way of implementing/overriding methods 
automatically; instead for each method in the interface you'd need to 
keep a delegate around for the life of the object. Additionally, 
interfaces pose an additional problem in that there's no base class you 
can put glue code in; you'd need a helper class of some sort that 
managed the native<->managed conversions.

I get the feeling that it's mostly GtkCellRenderer that people are going 
to want to implement. If that's the case, it should be possible to 
implement a "Gtk.CellRendererCustom" base class that hooked into a 
"GtkCellRendererCustom" class in a C glue library. Such a thing already 
exists in pygtk and would probably take an experienced hacker no more 
than a day or two to implement.

-- Rachel

Todd Berman wrote:

>I know currently you are unable to implement a GInterface from a C#
>I am wondering what barriers exist to having this possible? Particularly
>for custom cell renderers being written from c#.
>As far as I'm concerned, requiring some boilerplate of some kind in a
>ctor or somewhere else would be totally cool, especially over not having
>the ability to do it at all.
>Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com