Re: GtkCombo - load list dynamically
- From: gtk-app-devel-list andrew pimlott net
- To: Timbury <timbury_98 yahoo com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: GtkCombo - load list dynamically
- Date: Sun, 12 May 2002 15:25:08 -0400
On Sat, May 11, 2002 at 06:58:53PM -0700, Timbury wrote:
while(!feof(fp))
{
if(fgets(line, 128, fp)) {
printf("%p %s", line, line);
combo1_items = g_list_append (combo1_items, line);
When you pass line to g_list_append, it does not (cannot) make a
copy. So every entry in the list is a pointer to the same buffer,
which fgets overwrites every time through the loop.
Pass a copy to g_list_append.
Andrew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]