[9476] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: GList problem

daemon@ATHENA.MIT.EDU (Dave Cole)
Wed Oct 21 21:40:59 1998

To: gtk-list@redhat.com
From: Dave Cole <dave@dccs.com.au>
Date: 22 Oct 1998 11:40:40 +1000
In-Reply-To: Wesley Lemke's message of "Wed, 21 Oct 1998 20:32:14 -0500 (CDT)"
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


> > for(i = 1; i <= WEEKS; i++)
> > {
> >         sprintf(string, "Week %d", i);
> >         list = g_list_append(list, string);
> >         printf("%s\n", string);
> > }
> >
> > g_list_foreach(list, (GFunc) PrintList, NULL);


Change:
	void PrintList(char* str)
	{
	    puts(str);
	}

	list = g_list_append(list, string);

to:
	void PrintList(GString* gstr)
	{
	    puts(gstr->str);
	}

	list = g_list_append(list, g_string_new(string));

- Dave

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS dpu s-:+ a C++$ ULS++$ P+++$>++++ L++>+++$ E+>++ W N++ !o K w++$ O !M-
!V(-) PS+ PE- Y+ PGP !t-- 5++ X R tv b+ DI+++ D G e++ h--- r+++ y++++
------END GEEK CODE BLOCK------

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post