[Gtk-sharp-list] Word wrapping in a Gtk# TreeView

Baltasar GarcĂ­a Perez-Schofield baltasarq at gmail.com
Wed Jan 11 10:19:59 UTC 2017


Hi, there, I'm using a TreeView as a list box (i.e., I use a ListStore and
plain text elements).
While adding columns, I include the following code:

==
// Add columns
for(int colNum = 0; colNum < this.NumCols -1; ++colNum)
{
    column = new Gtk.TreeViewColumn {
              Title = this.Headers[ colNum ],
              Sizing =
                 Gtk.TreeViewColumnSizing.Autosize };
    cellRenderer = new Gtk.CellRendererText {
              WrapMode = Pango.WrapMode.WordChar };
    column.PackStart( cellRenderer, true );

    column.AddAttribute( cellRenderer, "text", colNum + 1 );
    cellRenderer.Edited += OnCellEdited;
    tvTable.AppendColumn( column );
}
==

The objective here is to achieve a list box in which each option can have
multiple rows. Using Pango.WrapMode.WordChar makes me include the Pango
assembly reference mandatorily. That is not a problem, but yet it still
does not work.

What mudt I don in order to achieve word wrapping?
Is this possible at all?

Regards,
-- Baltasar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20170111/270a1371/attachment-0001.html>


More information about the Gtk-sharp-list mailing list