Re: problem with combo box



>>>>> "PL" == A Dark Elf <drow@DarkElf.net> writes:

 PL> I just found out some weird stuff about the combo widget. I input
 PL> stuff from a file, line by line, and when the line begins by the
 PL> right letter, I add it to the combo box. The problem is the wrong
 PL> lines appear on the screen. So I made a test:

 PL> gtk_text_insert (GTK_TEXT (text), NULL, &color, NULL, line, -1);
 PL> printf("%s\n", line);
 PL> cbitems = g_list_append(cbitems, line);

 PL> The text widget has the right lines, the right lines are on the
 PL> screen, but the combo widget outputs empty lines.

 PL> Go figure....

What do you do with link after the append?

gtk_text_insert copies the text inserted, printf sends the text to
stdout, and couldn't care less what happens afterwards, but
g_list_append just inserts the pointer.

If you mess around with line after the append, you're probably
shooting yourself in the foot...and this could be what happens.

If you copy line before you append it, it should work fine...

/mailund



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