Re: sprintf and clists



gchar buffer[1024];
static gchar *cclist[1];

sprintf(buffer, "%d", some_dumb_int);
cclist[0] = strdup(buffer);
gtk_clist_append(GTK_CLIST(clist1), cclist);

This is assuming you have a 1 column clist.

For more columns, increase cclist[1] to number of columns.
Also setup the cclist[] for each column.

Sean

On Tuesday 25 June 2002 03:00 am, Carlos wrote:
> I want to convert some gint into gchar with sprintf to put them into a
> clist, but this function cause me segmentaion fault, what can I do ?
>
> -------------------------------------------------------------
> NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs,
> Toolbar... Web/Wap : www.netcourrier.com
> Téléphone/Fax : 08 92 69 00 21 (0,34 ? TTC/min)
> Minitel: 3615 NETCOURRIER (0,15 ? TTC/min)
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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