[Vala] Type.from_name() / unregistered types
- From: Dennis Möhlmann <in dev nyda info>
- To: Vala-list <vala-list gnome org>
- Subject: [Vala] Type.from_name() / unregistered types
- Date: Thu, 23 Aug 2012 12:20:25 +0200
Hello,
I'm looking for a way to to create instances of a class (all subclasses
of a common parent) by its class-name (string, not identifier).
Type.from_name() + Object.new() seem to work well, but only if the type
has been used before (i.e. instanced or typeof()'ed). Otherwise the
result is Type.INVALID.
I have no previous knowledge of the GObject system, but apparently a
type needs to be registered and vala does that automatically once the
type used in some way. Is it possible to do this manually with only the
string name of the type available?
Thanks,
Dennis
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]