-
-
Save chamons/f5d848a6782382dd9344e2b4be42f0e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using AppKit; | |
using Foundation; | |
namespace SavePanelTest | |
{ | |
public static class NSSavePanelPatch | |
{ | |
[System.Runtime.InteropServices.DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")] | |
extern static IntPtr IntPtr_objc_msgSend (IntPtr receiver, IntPtr selector); | |
public static NSSavePanel GetSavePanel () | |
{ | |
return ObjCRuntime.Runtime.GetINativeObject<NSSavePanel> (IntPtr_objc_msgSend (ObjCRuntime.Class.GetHandle ("NSSavePanel"), ObjCRuntime.Selector.GetHandle ("savePanel")), true); | |
} | |
} | |
[Register ("AppDelegate")] | |
public class AppDelegate : NSApplicationDelegate | |
{ | |
public override void DidFinishLaunching (NSNotification notification) | |
{ | |
NSSavePanel panel = NSSavePanelPatch.GetSavePanel (); | |
panel.RunModal (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment