Exemple #1
0
        public void Run()
        {
            Monobjc.ObjectiveCRuntime.LoadFramework("Cocoa");
            Monobjc.ObjectiveCRuntime.Initialize();

            NSApplication.Bootstrap();
            NSApplication.LoadNib("Main.nib");
            NSApplication.RunApplication();
        }
Exemple #2
0
        static void Main(string[] aArgs)
        {
            // when built with scons, the executing assembly appears in the KinskyDesktop.app/Contents/MacOs folder
            // whereas under MonoDevelop it is in the KinskyDesktop.app/Contents/Resources folder - this code will handle both
            string exeFolder      = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
            string contentsFolder = Path.GetDirectoryName(exeFolder);
            string resFolder      = Path.Combine(contentsFolder, "Resources");

            KinskyDesktop.Properties.Resources.SetBasePath(resFolder);

            ObjectiveCRuntime.LoadFramework("Cocoa");
            ObjectiveCRuntime.LoadFramework("Quartz");
            ObjectiveCRuntime.Initialize();

            NSApplication.Bootstrap();
            NSApplication.LoadNib("MainMenu.nib");
            NSApplication.RunApplication();
        }
Exemple #3
0
 /// <summary>
 /// First method called.
 /// </summary>
 public static void Main()
 {
     try {
         //
         // NOTE: refer to monobjc documentation about this code.
         // load cocoa library
         ObjectiveCRuntime.LoadFramework("Cocoa");
         ObjectiveCRuntime.Initialize();
         //
         NSApplication.Bootstrap();
         // load application bundle
         NSApplication.LoadNib("Window.nib");
         NSApplication.RunApplication();
         //
     } catch (Exception exc) {
         // log errors:
         if (logger.IsFatalEnabled)
         {
             logger.Fatal("An exception at the top level was catched.", exc);
         }
     }
 }