コード例 #1
0
 Pango.Layout GetLayout(Gtk.Widget widget)
 {
     return(widget.CreatePangoLayout(string.Empty));
 }
コード例 #2
0
ファイル: Util.cs プロジェクト: GNOME/gnome-subtitles
 	//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;
   }