Problem with GtkCList a dynamically creating with N columns...



Hi guys,

I looked through the archives for a solution to this problem, but the only solution I found still seg-faulted for me. Basically, if you want to create a GtkCList with titles, you need to use the function call

GtkWidget * grid;
char *blankrow[] = {"", "", "", ""};

gtk_clist_new_with_titles(4, blankrow);

The problem is, since I want to build the GtkCList with the result of an SQL query, I'm not going to know ahead of time exactly how many columns are going to be needed. I will be able to find out how many columns are needed after the program has started, and use that to dynamically create the blankrow, but so far, every way I've tried has come up empty. Hard-coding the blankrow like I did above isn't an option.

My question is this: how do I create blankrow of N columns containing N ""'s, during runtime? Maybe this is more of a C question than a Gtk question... if anybody could help, I'd really appreciate it. I'm going nuts here.

The only solution put forward, to initialize it using

widget = gtk_clist_new_with_titles(cols, "");

didn't work when I had more than 2 columns.

(alternate question, is this one of the things that's going to be dealt with in the upgrade to Gtk2? I read both GtkCList and GtkCTree are supposed to be dropped or something for that release...)

Sorry for any typos.

-andrew
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





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