Re: [Vala] [ModuleInit]?

Hi Michael,

It seems like you are confused with GModule and GTypeModule. Those two
are different.

Refer to

I have been fortunately using this attribute recently to automatically
preregister all types in one init function.

[ModuleInit] generates a function that registers all the types in the
vala module to the passed-in TypeModule parameter.

Refer to
for a common pitfall. The example on vala wiki at gnome live is
illuminating but sort of obsolete.



On Mon, Mar 2, 2009 at 7:40 PM, Michael 'Mickey' Lauer
<mickey vanille-media de> wrote:
What is this decorator supposed to do?

I stumbled over it when experimenting with shared objects, but it
doesn't seem to have any effect, at least not changing the function it
decorates to be called at init time.

For this, it looks we need a

public string g_module_check_init(TypeModule module)

in the module -- which works fine and gets called on init-time.

Am I missing something or is ModuleInit perhaps completely unrelated to
loading shared modules? In that case, we need to fix the wiki page :)



Vala-list mailing list
Vala-list gnome org

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