[Mono-dev] Usage of construct properties in a wrapped GObject library
Mike Kestner
mkestner at gmail.com
Thu Apr 30 08:39:30 EDT 2009
On Mon, 2009-04-27 at 11:42 -0700, MardyTardi wrote:
> =============
> public Map () : base (IntPtr.Zero)
> {
> if (GetType () != typeof (Map)) {
> CreateNativeObject (new string [0], new GLib.Value[0]);
> return;
> }
> Raw = osm_gps_map_new();
> }
> =============
> osm_gps_map_new() is the C constructor of my GObject, but what I'd like to
> have is a constructor which accepts a list of properties + values, and pass
> it to g_object_newv(). But I cannot find an equivalent for g_object_newv()
> in C#, that's why I'm stuck.
>
> Any hints?
You may have figured this out already, but the CreateNativeObject call
in that generated call is the equivalent of g_object_newv. The string[]
is a list of property names. The GLib.Value[] is their corresponding
values.
--
Mike Kestner <mkestner at gmail.com>
More information about the Mono-devel-list
mailing list