Hi, Andrey,

Thank you, I was able to make it work using your example.
The problem I'm facing now is that my window is resizable, so I've added an
event handler to the treeview's onexpose, with this code:

==
private void OnTreeViewResized()
{
    foreach (Gtk.TreeViewColumn column in this.tvTable.Columns) {
        ( (Gtk.CellRendererText) column.CellRenderers[ 0 ] ).WrapWidth =
column.Width;
    }
}
==
...and it (almost) works. The problem is that, when I make the window
larger, the text adapts to the new width correctly, but the height that was
needed before in order to accomodate the text in each row is still
used/wasted as blank space.
This is weird... how could I solve that?

-- Baltasar


El mié., 11 ene. 2017 a las 12:49, Andrey Gankov via Gtk-sharp-list (<
[email protected]>) escribió:

> Yes, This is possible.
> Try set max width for warp, WrapWidth or MaxWidth or both.
>
> The following code 100% works
> ActivityCell.WrapMode = Pango.WrapMode.WordChar;
> ActivityCell.WrapWidth = 500;
> ActivityColumn.MaxWidth = 500;
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Word-wrapping-in-a-Gtk-TreeView-tp4669628p4669631.html
> Sent from the Mono - Gtk# mailing list archive at Nabble.com.
> _______________________________________________
> Gtk-sharp-list maillist  -  [email protected]
> http://lists.dot.net/mailman/listinfo/gtk-sharp-list
>
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.dot.net/mailman/listinfo/gtk-sharp-list

Reply via email to