• 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: Two clicks to dismiss a sheet?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two clicks to dismiss a sheet?


  • Subject: Re: Two clicks to dismiss a sheet?
  • From: Tito Ciuro <email@hidden>
  • Date: Sun, 17 Sep 2006 12:42:02 -0700

Hi Nick,

I forgot to mention that I need a non-callback sheet. Your solution works great, but the callback it's not the place where I need to check for the button choice. Example:

In the '- (BOOL)selectionShouldChangeInTableView:(NSTableView *) aTableView' delegate method I need to check whether a record that I'm editing is dirty. If so, I present a sheet to give the user a chance to save the changes. If the user cancels, I'd like to return NO, otherwise YES. This is why I was trying to introduce a non-callback sheet.

Any suggestions how to accomplish this?

Thanks for your help,

-- Tito

On Sep 16, 2006, at 2:25 PM, Nick Zitzmann wrote:


On Sep 16, 2006, at 5:42 AM, Tito Ciuro wrote:

After I display a sheet, it take two clicks to dismiss it. Any idea why?

You're running a sheet as an application-modal window. Sheets are window-modal, not application-modal. Try this instead: (pseudo-code written in Mail; it won't compile)


- (void)someMethod
{
NSBeginCriticalAlertSheet(@"title", nil, nil, nil, window, self, @selector(sheetDidEnd:returnCode:contextInfo:), NULL, NULL, @"message");
}


- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
// do something here if you want to, then...
[sheet orderOut:self];
}


Nick Zitzmann
<http://www.chronosnet.com/>





_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Two clicks to dismiss a sheet?
      • From: Nick Zitzmann <email@hidden>
References: 
 >Two clicks to dismiss a sheet? (From: Tito Ciuro <email@hidden>)
 >Re: Two clicks to dismiss a sheet? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Checkbox in menuitem...
  • Next by Date: Re: Drawing 32-bit images into an NSBitmapImageRep
  • Previous by thread: Re: Two clicks to dismiss a sheet?
  • Next by thread: Re: Two clicks to dismiss a sheet?
  • Index(es):
    • Date
    • Thread