Skip to content

Instantly share code, notes, and snippets.

@chamons

chamons/foo.cs Secret

Created September 20, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/b6bc277c78ca60198e8567ea74dd3f58 to your computer and use it in GitHub Desktop.
Save chamons/b6bc277c78ca60198e8567ea74dd3f58 to your computer and use it in GitHub Desktop.
using AppKit;
using CoreGraphics;
using Foundation;
namespace XamarinMacMojaveTest2
{
[Register("AppDelegate")]
public class AppDelegate : NSApplicationDelegate
{
MyViewTest outlineViewTest;
public override void DidFinishLaunching(NSNotification notification)
{
outlineViewTest = new MyViewTest ();
}
}
public class MyViewTest : NSObject
{
NSWindow Window;
NSOutlineView Outline;
public MyViewTest ()
{
NSWindowStyle windowStyle = NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
Window = new NSWindow (new CGRect (100, 100, 500, 500), windowStyle, NSBackingStore.Buffered, false);
NSView outlineView = MakeView (Window.ContentView.Bounds);
Window.ContentView.AddSubview (outlineView);
Window.MakeKeyAndOrderFront (this);
}
NSView MakeView (CGRect frame)
{
Outline = new NSOutlineView (frame);
NSScrollView scrollView = new NSScrollView (frame);
scrollView.DocumentView = Outline;
return scrollView;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment