Found a solution myself:
Create this function somewhere accessible:
//------------------------------------------------
void SizeAllocation (object p_label, Gtk.SizeAllocatedArgs args)
{
(p_label as Label).SetSizeRequest(args.Allocation.Width - 2, -1);
}
//------------------------------------------------
And then assign it to the label you want to:
//------------------------------------------------
lblOne.SizeAllocated += SizeAllocation;
//------------------------------------------------
I got the idea from this article:
http://tadeboro.blogspot.com/2009/05/wrapping-adn-resizing-gtklabel.html
The author says that it has some bugs, but I didn't encounter any, so imo
this works and is pretty small.
Also, if it is so easy to fix, makes you wonder even harder what gtk# devs
are doing ;)
--
View this message in context:
http://mono.1490590.n4.nabble.com/Dynamic-Label-Wrapping-How-tp4245795p4246700.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list