There are a few ways of going about this.  If the list is not very big,
you can get gtk to automatically resize a column with the
GtkCList.set_column_auto_resize(col) method.  If you want to find the
width of a particular piece of text and you have a reference to the font
object (widget.get_style().font is one way to get a reference), you can
use the font object's width() method:
  w = font.width("A string I want to know the width of")

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Wed, 30 Jun 1999, Harry Henry Gebel wrote:

> Hello,
>       I am just learning to program X and so far the only experiance I have
> had is using python and pyGTK/pyGnome. I am writing a program that uses
> the GtkCList class and in the GTK tutorial they stress the importance of
> setting the correct widths for the various columns, at first I was just
> going to use the settings that worked best on my computer as it is
> currently set up, but then it occured to me that if I changed my default
> font or if I gave the program to someone else who was using a different
> font than the one I use that the best values for the column width would
> also change.
>       Looking at the example at the bottom of the GtkClist section of the GTK
> tutorial they don't show how to get any font info. I found the area in
> the GDK referance docs that tells how to get font info on a particular
> font, but I have not been able to find anything on how to find out what
> font is being used. If anyone can tell me where to find this I would be
> grateful.
> 
>       -Harry
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to