[Mono-dev] Usage of construct properties in a wrapped GObject library

MardyTardi mardy at users.sourceforge.net
Mon Apr 27 14:42:12 EDT 2009


Michael Hutchinson wrote:
> On Sun, Apr 26, 2009 at 11:38 AM, mardy.tardi
> <mardy at users.sourceforge.net> wrote:
>> I guess that by modifying the C library by adding more _new() methods I
>> can
>> get more constructors in the C# API, but is there some other way around
>> it,
>> without modifying the C API?
>
> Use .custom files to add custom constructors into the C# wrapper.
>
> http://mono-project.com/GAPI#.custom_files

Thank you both. Actually what I need is an explanation on how to write the
actual code; I know GObject well, but I'm totally new to C#.
The auto generated constructor is:

=============
        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?

Ciao,
  Alberto

-- 
http://www.mardy.it <- geek in un lingua international! 
-- 
View this message in context: http://n2.nabble.com/Usage-of-construct-properties-in-a-wrapped-GObject-library-tp2726035p2727814.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list