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:47:01 +0100
Sorry, I gave you a wrong answer, about the method signature.
Someone gave me the answer offlist though. I have
to explicitly close() the sheet before trying to performClose() on the
window.
You can also pass your NSSelector as the "didDismissSelector":
After the sheet is dismissed, the didDismissSelector is invoked
Mercoledl, marzo 19, 2003, alle 12:05 , ho scritto:
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.