return ret;
}
- //Removed from v0.2.33
- /*public bool AddIdle(System.Delegate func)
+
+ public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
+ {
+ NUILog.Debug(" NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode) is called! ");
+
+ Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ // we've got an application now connect the signals
+ ret.SetupDelegates();
+ // set the singleton
+ _instance = ret;
+ return _instance;
+ }
+
+ /// <summary>
+ /// Ensures that the function passed in is called from the main loop when it is idle.
+ /// </summary>
+ /// <param name="func">The function to call</param>
+ /// <returns>true if added successfully, false otherwise</returns>
+ public bool AddIdle(System.Delegate func)
{
- System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));