-
-
Save chamons/d450d138279ad38df720 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 Foundation; | |
using AppKit; | |
namespace CloseTest | |
{ | |
public class TestDelegate : AppKit.NSWindowDelegate | |
{ | |
public override bool WindowShouldClose (NSObject sender) | |
{ | |
Console.WriteLine ("Should"); | |
return true; | |
} | |
public override void WillClose (NSNotification notification) | |
{ | |
Console.WriteLine ("On"); | |
} | |
} | |
public partial class MainWindow : NSWindow | |
{ | |
public MainWindow (IntPtr handle) : base (handle) | |
{ | |
} | |
[Export ("initWithCoder:")] | |
public MainWindow (NSCoder coder) : base (coder) | |
{ | |
} | |
public override void AwakeFromNib () | |
{ | |
base.AwakeFromNib (); | |
this.Delegate = new TestDelegate(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment