Re: [Vala] class constructor not being called





On Sat, Mar 16, 2013, at 12:15 PM, Jonas Kulla wrote:
[...]
Hi,

Your function 'noop()' is declared static, hence no instance is required
to
call it.
Class constructors are called on the first construction of an instance,
ie.
when you do 'new MyClass();' .

Jonas

I'm looking to create a static class (or whatever the correct way to to
this in vala).  Basically I need a class that will have all static data,
so I won't require to initialize the class.  It will have some static
methods and a HashMap.  I'm trying to initialize the HashMap.  I thought
a class/static constructor would do the trick.  Apparently this is not
the preferred method.  Do you know what is?

thanks,
-a



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