[Mono-osx] Working with delegates

Miguel de Icaza miguel at novell.com
Tue Nov 30 10:40:14 EST 2010


>
>
> I know two possibilities: use object of separate class which will
> inherit from NSWindowDelegate, overriding specific methods; or mark
> [Export("windowShouldClose:...")] methods in your controller class.
>
> There may be other ways, though.
>

That pretty much covers it.

To recap, if you want to go strongly typed, you have two options: (a)
inherit from NSWindowDelegate and override methods or (b) Use C# events
exposed on the NSWindow class.

If you do not mind going loosely typed, then all you have to do is create
any class that derives from NSObject and decorate the methods with [Export]
very much like we do in the source code for MonoMac itself.

Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101130/08941dc4/attachment.html 


More information about the Mono-osx mailing list