Re: Determining width of a clist entry



Chris Wareham wrote:
> 
> Hi!
> 
> I'm trying to set the width of the columns in a CList using:
> 
>   gtk_clist_set_column_width(GTK_CLIST(clist), column, width);
> 
> I think I need to do this using:
> 
>   gdk_string_measure(GdkFont *font, const gchar *string);
> 
> The column entries are in a glib linked list, so what I want
> to do is keep an array of maximum widths which I update as I
> insert into the CList.
> 
> My problem is, how do I determine the GdkFont that my CList
> is using?

The short answer is:

    gtk_widget_get_sytle(clist)->font

 ... BUT ...

It sounds like gtk_clist_optimal_column_width() or even
gtk_clist_set_column_auto_resize() will do what you want.

Cheers, Matt
-- 
Matt Goodall, Software Engineer  |  Isotek Electronics Ltd
mailto:mgg isotek co uk          |  Claro House, Servia Road
http://www.isotek.co.uk          |  Leeds, LS7 1NL
Tel: +44 113 234320              |  England




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]