Re: dismissing one sheet for another problem
Re: dismissing one sheet for another problem
- Subject: Re: dismissing one sheet for another problem
- From: Dan Saul <email@hidden>
- Date: Tue, 18 Jan 2005 10:39:20 -0600
It states that you are not suppoed to do that in HIG, however it is
supported and it does work, hell even XCode does this (can't remember
where off the top of my head however).
On Tue, 18 Jan 2005 14:19:14 +0100, M. Uli Kusterer
<email@hidden> wrote:
> At 5:08 Uhr -0800 18.01.2005, Theodore Petrosky wrote:
> >The first sheet dismisses and the second
> >(NSWarningAlertStyle) comes up. However the OK button
> >does not work. I am using this same code elsewhere
> >(but not directly after dismissing a different sheet)
> >and it works just fine.
> >
> >Any ideas? I tried replacing the endSheet with [NSApp
> >stopModal]; and it is the same.
> >
> >More info. Since the OK button was 'selected' I tried
> >typing a return and lo and behold the warning sheet
> >dismissed however the app was left in an unresponsive
> >state. Nothing works, all the menus are greyed out.
>
> Aaaahhhh!!! The beauty of nested event loops! :-)
>
> IIRC endSheet doesn't immediately cause the current modal event loop
> to exit, but rather just sets a flag so, once your script finished,
> the event loop will terminate. But with your code you bring up an
> alert from inside the event loop, and thus you're causing two nested
> modal event loops.
>
> I don't think having two nested sheets on a window is even supported.
>
> I think what you want is to move the code that shows the alert out
> of the modal event loop, so the first sheet is completely torn down
> and ended when the second one comes out. Sadly you're not saying what
> method the code you posted is in. Is this in your didEndSelector? If
> not, move it over into that. If it is, you'll need to use a timer or
> a scheduled message outside the modal loop to trigger the alert
> instead.
> --
> Cheers,
> M. Uli Kusterer
> ------------------------------------------------------------
> "The Witnesses of TeachText are everywhere..."
> http://www.zathras.de
> _______________________________________________
> 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
>
_______________________________________________
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