Hi,

I have a cellrenderer implementation that renders arbitrary cairo drawings in each cell, although it appears that the source code isn't publicly available right now.

If anyone would be interested in this I should be able to release it.

John L.
 
From: Ivan Perez <ivanperezdominguez@gmail.com>

Hi, Jos?,

The amount of cell renderers in gtk2hs covers many cases (see [1]). If
the kind of renderer that you are looking for is not implemented
anywhere (not even in C), you might have to implement your own. This
is described in [2] and [3]. I haven't tried either of them.

Note, however, that:
1) Text cell renderers can be editable (see [4]).
2) You can always limit the number of rows, but I don't know how it
will behave (see [5]). I also don't know if scroll bars are shown.
3) Treeviews can be embeded in scrollviews. Adding elements with
scrolls to the cells may make the treeview unscrollable (with the
mouse wheel). I don't know how the treeview will behave if all the
elements inside have scroll bars, as the inner widgets will handle the
mouse wheel events and these will never reach the top (scrollview)
level. This may also be counterintuitive for users.

Let us know if you end up implementing this. I'd be happy to see it working.

Cheers,
Ivan

[1] http://hackage.haskell.org/packages/archive/gtk/0.12.3/doc/html/Graphics-UI-Gtk-ModelView-CellRenderer.html#t:CellRenderer
[2] http://faq.pygtk.org/index.py?req=show&file=faq13.045.htp
[3] http://scentric.net/tutorial/sec-custom-cell-renderers.html
[4] http://hackage.haskell.org/packages/archive/gtk/0.12.3/doc/html/Graphics-UI-Gtk-ModelView-CellRendererText.html#v:cellTextEditable
[5] http://hackage.haskell.org/packages/archive/gtk/0.12.3/doc/html/Graphics-UI-Gtk-ModelView-CellRendererText.html#v:cellRendererTextSetFixedHeightFromFont

On 18 December 2012 13:10, Jos? Romildo Malaquias <j.romildo@gmail.com> wrote:
> On Tue, Dec 18, 2012 at 12:48:01PM +0100, Ivan Perez wrote:
>> Hi Romildo,
>>
>> If I understand your question correctly, a simple '\n' (end of line
>> character) should suffice. I'm attaching a modified version of the
>> standard TreeView example on the wiki that renders several lines per
>> cell. Does this solve your problem?
>
> I want something like a TextView as a cell renderer. It would be
> possible to specify the renderer size (width and height) and scroll bars
> would be available if needed.
>
> This may not be possible with a CellRendererText. Probably a larger text
> (with many lines) would produce a too large renderer cell on the screen.
>
> Romildo