• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Beginner question with sheets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Beginner question with sheets (From: Enrico Stamigna <email@hidden>)

  • Prev by Date: Re: NSAutoreleasePool: how does it really work?
  • Next by Date: Re: Adding a method makes a class abstract?
  • Previous by thread: Re: Beginner question with sheets
  • Next by thread: NSImageCell cellSize
  • Index(es):
    • Date
    • Thread