[pygtk] Label width in chars ?
Adam Tauno Williams
awilliam at whitemice.org
Sat Feb 18 00:46:35 WST 2012
On Thu, 2012-01-19 at 00:47 +0100, Jérôme wrote:
> I don't understand how a label width can be specified in chars.
> Does this refer to a conventional width, that may depend on the font size ?
> For instance, if I set a width of 10 chars, and I'm not using a monospace
> font, there won't be the same amount of space left whether my string is
> '..........' or 'mmmmmmmmmm'.
> http://pygtk.org/docs/pygtk/class-gtklabel.html
Correct, AFAIK. Given the current font/size width-charts dynamically
[attempts to] size the label. This is part of Pango's
pango_font_description_... stuff I believe. A given font/size has a
default or average width for a character used for geometry calculations.
> "width-chars"
> Read-Write
> The desired width of the label, in characters. If this property is set to -1,
> the width will be calculated automatically, otherwise the label will request
> either 3 characters or the property value, whichever is greater. Allowed
> values: >= -1. Default value: -1. Available in GTK+ 2.6 and above.
--
System & Network Administrator [ LPI & NCLA ]
<http://www.whitemiceconsulting.com>
OpenGroupware Developer <http://www.opengroupware.us>
Adam Tauno Williams
More information about the pygtk
mailing list