[Gtk-sharp-list] extending CellRenderer

Michael Quinn mikeq@wam.umd.edu
Sun, 09 Jan 2005 11:55:52 -0500


I'm trying to extend a CellRenderer, trying to make an ellipsizing
CellRenderer.  But right now, I'm just playing around with extending a
CellRenderer.  I have this:

public class CellRendererEllipsize : CellRendererText
{
   protected override void Render (Drawable window, Widget widget,
Rectangle background_area, Rectangle cell_area, Rectangle expose_area,
CellRendererState flags)
   {
      base.Render(window, widget, background_area, cell_area,
expose_area, flags);
   }
}

Now, unless i'm not thinking straight, this should act exactly like a
regular CellRendererText, right?  The problem is whenever I try to use
it I get this:

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
in (unmanaged) (wrapper managed-to-native)
Gtk.CellRenderer:gtksharp_cellrenderer_base_render
(intptr,intptr,intptr,Gdk.Rectangle,Gdk.Rectangle,Gdk.Rectangle,Gtk.CellRendererState)


Is this a bug in GTK#, or am I just not thinking properly?

-- 
Michael Quinn <mikeq@wam.umd.edu>