aboutsummaryrefslogtreecommitdiff
path: root/SuperPolarityMac/Program.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2014-02-10 22:14:10 -0600
committerBen Beltran <ben@nsovocal.com>2014-02-10 22:14:10 -0600
commit63419029fbda7d3f2f3d5984c3d2c77f341dbd79 (patch)
treef4c0a51017b957f2dfded3b4fc6b8ff3c3b58e45 /SuperPolarityMac/Program.cs
parent10980f9b5db812487ecc118fa8f8255024624e9a (diff)
Works in win, compiles in mac
Diffstat (limited to 'SuperPolarityMac/Program.cs')
-rw-r--r--SuperPolarityMac/Program.cs56
1 files changed, 37 insertions, 19 deletions
diff --git a/SuperPolarityMac/Program.cs b/SuperPolarityMac/Program.cs
index 6c3f614..e6ab5cf 100644
--- a/SuperPolarityMac/Program.cs
+++ b/SuperPolarityMac/Program.cs
@@ -1,26 +1,44 @@
-#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
-#endregion
+using MonoMac.AppKit;
+using MonoMac.Foundation;
namespace SuperPolarity
{
-#if WINDOWS || LINUX
- /// <summary>
- /// The main class.
- /// </summary>
- public static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- using (var superPolarity = new SuperPolarity())
- superPolarity.Run();
- }
- }
-#endif
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ static void Main (string[] args)
+ {
+ NSApplication.Init ();
+
+ using (var p = new NSAutoreleasePool ()) {
+ NSApplication.SharedApplication.Delegate = new AppDelegate ();
+ NSApplication.Main (args);
+ }
+
+
+ }
+ }
+
+ class AppDelegate : NSApplicationDelegate
+ {
+ SuperPolarity superPolarity;
+
+ public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+ {
+ superPolarity = new SuperPolarity();
+ superPolarity.Run ();
+ }
+
+ public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
+ {
+ return true;
+ }
+ }
}
+
+