Re: [Vala] Purple.CoreUiOps



On 02/17/2012 11:16 PM, Luca Bruno wrote:
On Fri, Feb 17, 2012 at 3:38 PM, Joseph Montanez<jmontanez gorilla3d com>wrote:

My brain is melting trying to figure out how to get Purple.CoreUiOps
to initialize.

Here is the vapi:
        [CCode (cheader_filename = "purple.h")]
        [Compact]
        public class CoreUiOps {
                [CCode (has_construct_function = false)]
                public weak GLib.Callback debug_ui_init;
                public weak GLib.Callback get_ui_info;
                public weak GLib.Callback quit;
                public weak GLib.Callback ui_init;
                public weak GLib.Callback ui_prefs_init;
        }

>> I just tried creating an object:
>> var ui_ops = new Purple.CoreUiOps();
>> *error: `Purple.CoreUiOps' does not have a default constructor
>>      var ui_ops = new Purple.CoreUiOps();*

Try with a struct.



Shouldn't compact class install a default constructor when no constructor was provided by user?

Besides, what's the difference between compact class and struct when wrapping non-gobject C lib? Should we always use public struct when wrapping C structs?





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