Re: Beginner question with sheets
Re: Beginner question with sheets
- Subject: Re: Beginner question with sheets
- From: Enrico Stamigna <email@hidden>
- Date: Wed, 19 Mar 2003 12:05:43 +0100
Hello,
Look at the NSSelector parameters list array:
public void closeWindow(Object sender)
{
NSAlertPanel.beginAlertSheet(
"Close Window", "Close", null, "Cancel", window, this,
new NSSelector("closeOrNot", new Class[]
{NSWindow.class, Integer.class, Object.class}),
The second parameter Class should be "int.class" instead of
"Integer.class".
Using MacOS X 10.1.5, you should get a "java.lang.NoSuchMethodException".
Do you get a different behaviour?
null, sender, "Do you really want to close the window?");
}
public void closeOrNot(NSWindow sheet, int returnCode, Object
contextInfo)
{
System.out.println("returnCode=" + returnCode);
System.out.println("contextInfo=" + contextInfo);
if (returnCode == NSAlertPanel.DefaultReturn)
window.performClose(contextInfo);
}
Enrico Stamigna
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.