On Fri, Oct 24, 2003 at 04:21:47PM +0800, James Henstridge wrote:
> >I need a TextView that changes its width depending on the maximum number
> >of characters per line that the user wants it to have. I need that the
> >user be able to configure it to have between a number of characters per
> >line and that it changes its width to have exactly the maximum number
> >they choose.
> >
> Do something like the following:
> context = widget.get_pango_context()
> metrics = context.get_metrics('font name, 12')
> width = pango.PIXELS(metrics.get_approximate_char_width() * n_chars)
Added to (recently-moved) FAQ 4.15:
http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq04.015.htp
Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/