Re: Determining width of a clist entry
- From: Vlad Harchev <hvv hippo ru>
- To: Chris Wareham <chris wareham catchword com>
- Cc: gtk-list gnome org
- Subject: Re: Determining width of a clist entry
- Date: Thu, 14 Sep 2000 17:49:23 +0500 (SAMST)
On Thu, 14 Sep 2000, Chris Wareham wrote:
You might also want to use gtk_clist_set_column_auto_resize instead of all
this.
> Chris Wareham wrote:
> >
> > I'm trying to set the width of the columns in a CList using:
> >
>
> In answer to my own query:
>
> GtkStyle *style;
> gchar *rec[3];
>
> style = gtk_widget_get_style(GTK_WIDGET(clist));
>
> gtk_clist_freeze(GTK_CLIST(clist));
>
> for(li = list; li != NULL; li = g_list_next(li)) {
> Record *r = li->data;
>
> rec[0] = status;
> rec[1] = jobno;
> rec[2] = r->title;
>
> printf("%s : width(%d)\n", rec[2],
> gdk_string_width(style->font, rec[2]));
>
> /* update array of maximum column widths ... */
>
> gtk_clist_append(GTK_CLIST(clist), rec);
> g_free(r);
> }
> g_list_free(list);
>
> /* set column widths ... */
>
> gtk_clist_thaw(GTK_CLIST(clist));
>
> --
> turbo-powered tedium
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
Best regards,
-Vlad
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]