Re: fgets -> CList

The reason why your code doesn't work is simple. The second argument of
gtk_clist_append is not a char* but a char** (actually a char* []). Take
a look at:

In your code just try:
gtk_clist_append (GTK_CLIST (clist), &buffer);
It will work if your clist has only one column.


Thomas Bliesener wrote:

I want to read the rows for a clist widget from a file:

        char buffer[100];
        fgets (buffer, sizeof (buffer), fz);
        gtk_clist_append (GTK_CLIST (clist), buffer);

but this obviously doesn't work:

        create_clist.c:83: warning: passing arg 2 of `gtk_clist_append' from
        incompatible pointer type

How can I prepare the data from fgets for gtk_clist_append?
* Debian = GNU/Linux XP *

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

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