[Mono-osx] NSAlert Sheet
trip
andywhitt at gmail.com
Mon Feb 20 11:52:05 UTC 2012
Hope this helps:
/partial void buttonPressed (MonoMac.Foundation.NSObject sender)
{
var alert = new NSAlert { MessageText = "Beer?" };
alert.AddButton ("Yes"); // returnCode = 1000
alert.AddButton ("No"); // returnCode = 1001
alert.AddButton ("Maybe"); // returnCode = 1002
alert.BeginSheet (Window, this, new Selector
("alertDidEnd:returnCode:contextInfo:"), IntPtr.Zero);
}
[Export("alertDidEnd:returnCode:contextInfo:")]
public void alertDidEnd (NSAlert alert, int returnCode, NSObject
contextInfo)
{
Console.WriteLine (returnCode);
}/
You'll also need a /using MonoMac.ObjCRuntime;/
--
View this message in context: http://mono.1490590.n4.nabble.com/NSAlert-Sheet-tp4397574p4403840.html
Sent from the Mono - OSX mailing list archive at Nabble.com.
More information about the Mono-osx
mailing list