Re: appending a clist row



Hi.

I just wanted to tell my solution. Its seems to be a hack, but i do not have
to allocate and to free strings. I use global vars:

in a c-file i have to lines:

  char tstr[10][512];
  char* list[10] = {
    tstr[0], tstr[1],
    tstr[2], tstr[3],
    tstr[4], tstr[5],
    tstr[6], tstr[7],
    tstr[8], tstr[9]
  };

in the header file there is:

  extern char* list[10];

on a clist_append i initialize the strings tstr[x] and do a:

  row = gtk_clist_append(clist, list);

...done.
Note: You cannot handle clists with more than 10 columns and entries with
more than 511 chars.

Markus.




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