Re: [Vala] removing an element from a list



On 08/31/2009 10:59 PM, jezra lickter wrote:
On Mon, 31 Aug 2009 03:07:57 +0200
Jiří Zárevúcky<zarevucky jiri gmail com>  wrote:

On 08/31/2009 03:05 AM, Jiří Zárevúcky wrote:
On 08/31/2009 02:10 AM, jezra lickter wrote:
The word "test" is not removed from the list. Am I doing something
wrong, and is there a better way to do what I need?

The problem is that GLib.List searches for items based on pointer
value, not the actual data. You have to either use remove_custom or
(a much better possibility) use the Gee collection library. It is
much easier to use from Vala then GLib collection classes, which
were never intended for use in such high-level language.

I meant find_custom()  :) Anyway, Gee is the way to go.
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
Thanks, the Gee library worked like a charm although I would prefer to
not require another library for the application.

If the dependency concerns you, you can simply copy the class you use into your application. :) Vala compiler itself includes a copy of the whole library.



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