Re: [Vala] using List class object

-----Original Message-----
From: Joss 4 <gpnet abraerp it>
To: vala-list gnome org
Date: Thu, 28 May 2009 12:50:10 +0200
Subject: [Vala] using List class object

I was trying to use this test code  in windows env with vala 0.7.2
installed :

using GLib;

        GLib.List<string> list = new GLib.List<string> ();
            list.add ("one");
append should work fine
            list.add ("amore");
            list.add ("pippo");
            list.add ("Ava");
            //list.insert (2, 3);
insert ("preved", 2);
            //list.remove_at (3);
List have remove (G data) and remove_all (G data)
1. list.remove (list.nth_data (3));
2. list.remove ("Ava");
3. You can use var queue = new Queue<string> ().
 var v1 = queue.pop_nth (1); // for remove
 var v2 = queue.peek_nth (3) - for get value
also push_nth, push_tail, pop_head, pop_tail, etc
GLib.List have "sort (CompareFunc compare_func)"
list.sort (strcmp);
        stdout.printf ("%s\n", list.nth_data (0));
        foreach (string pi in list) {
                stdout.printf ("%s\n", pi);
but   when I try to compile the compiler seems to compile correctly ,
but doesn,' generate the .exe code.
I  checked the \vapi\Glib-2.0.vapi and I found the List class.  What
wrong ?

in this is specified to use   a
using Gee; statement , but i don't have any libGee.a in ..\vala-0.7.2\lib\.

could you help me please.

Please notice that in case you use community win32 build ( you 
should manually build LibGee (
But some official win32 build for libgee would be good in future.

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