[Mono-osx] [MonoMac] NSApplication.BeginSheet definition

kjpou kjpou at pt.lu
Tue Nov 16 09:27:28 EST 2010


Hello all

I would like to propose a change to the method definition for 
NSApplication.BeginSheet in appkit.cs

This allows the developer to supply "null" instead of the two parameters 
being mandatory when they are not used/needed.

Example:

NSApp.BeginSheet(window,sender.Window,this,new 
Selector("didEndSheet:returnCode:contextInfo:"),IntPtr.Zero);

------ Becomes ------

NSApp.BeginSheet(window,sender.Window,null,null,IntPtr.Zero);


------ Method Signature appkit.cs ------

From

[Export 
("beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:")]
void BeginSheet (NSWindow sheet, NSWindow docWindow, NSObject 
modalDelegate, Selector didEndSelector, IntPtr contextInfo);


To:

[Export 
("beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:")]
void BeginSheet (NSWindow sheet, NSWindow docWindow, [NullAllowed] 
NSObject modalDelegate, [NullAllowed] Selector didEndSelector, IntPtr 
contextInfo);

------------------------------------

This also fits the documentation:

Parameters


modalDelegate

The delegate object that defines your didEndSelector method. If nil, the 
method in didEndSelector is not called.

didEndSelector

An optional method to call when the sheet’s modal session has ended. 
This method must be defined on the object in the modalDelegate parameter 
and have the following signature:

Kenneth


More information about the Mono-osx mailing list