[pygtk] gtk.TextView dimensions

A.T.Hofkamp a.t.hofkamp at tue.nl
Tue Dec 18 18:33:31 WST 2007


Lennon Cook wrote:
> "A.T.Hofkamp" <a.t.hofkamp at tue.nl> wrote:
>> For a fixed font, take any character, query its width and height,
> How would I do this?

For text in 'self.name', I do

         pango_layout.set_text(self.name)
         xlen_text, ylen_text = pango_layout.get_pixel_size()

and that seems to work.



Albert


More information about the pygtk mailing list