Pango.Layout GetLayout(Gtk.Widget widget) { return(widget.CreatePangoLayout(string.Empty)); }
//TODO stop using this? Doesn't seem to be working for spin buttons anymore (which were updated OTM) public static int TextWidth (Widget widget, string text, int margins) { Pango.Layout layout = widget.CreatePangoLayout(text); int width, height; layout.GetPixelSize(out width, out height); return width + margins; }