[Gtk-sharp-list] Dynamic Label Wrapping - How?

TheSHEEEP thesheeep2 at web.de
Fri Dec 30 15:18:53 EST 2011

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:

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.

More information about the Gtk-sharp-list mailing list