[Gtk-sharp-list] How to write a custom Gtk.CellRenderer? (In C#)

Miquel Ramírez Miquel Ramírez
Mon, 11 Apr 2005 18:18:41 +0200


I would like to display a custom composite widget as the
representation of TreeView cells but I can't find any Gtk# specific
pointers on how to do that. I only found clear, specific, directions
on how to write my own cell renderer here:
http://scentric.net/tutorial/sec-custom-cell-renderers.html, but it
seems that the solution is to draw myself the widget using the
low-level primitives (boxes, points, etc.). Besides, that would be
just a lot of work implement it for a complex widget , and I feel that
implementing the drawing in C# would not be a very bright idea.

In principle, the idea would be to 'redirect' the drawing of the
widget I want to insert in the cell, into the Drawable associated to
that cell itself. Besides, I would like to reuse the composite widget
drawing code - otherwise it would not be very wise to pursue further
this issue.

Is it possible to reuse current Gtk basic widgets, say an HBox with
several widgets inside, to easily implement a custom Gtk.CellRenderer?
Which methods from Gtk.CellRenderer should be overriden - as I can't
sort it out from current Monodoc? Is there another, simpler way of
displaying a composite widget as a TreeView cell?

Thanks in advance,