Skip navigation.
 
mlRe: wired things about NSApp Modal
FROM : cai qin
DATE : Mon Feb 11 21:27:18 2008

---------- Forwarded message ----------
From: cai qin <<email_removed>>
Date: 2008-2-11 12:26
Subject: Re: wired things about NSApp Modal
To: Jens Alfke <<email_removed>>

Thank you for the rely.

In fact , I'm going to use the ocTest to build some automatic test.
So I get a Modal Window , I want to show it first ,then close it
automatically . I'm sure that the windowDidBecomeKey method did get called.
Perhaps I didn't describe my question clearly , which leads to some
misunderstanding.


Now I 'm using a NSTimer to call another method to abort Modal and close the
window. It works well.
But I still want to figure out why these wired things happened which like I
described in my question.




2008/2/9, Jens Alfke <<email_removed>>:
>
>
> On 8 Feb '08, at 6:50 PM, cai qin wrote:
>
> > I got a Window A. I call [NSApp RunModalForWindow] to make it modal
> > Inside Window A's notification method , windowDidBecomeKey , I call
> > [NSApp
> > abortModal] ,What I want to do is that not letting the window
> > showing up.
> > But the window is still showing up as Modal window ,but when you
> > switch the
> > app to others and then switch back , the window disappeared , and
> > the Modal
> > stops.
>
> Did you tell the window to become key? Perhaps it's not becoming key
> until you switch to another app and then back. You could set a
> breakpoint in your windowDidBecomeKey method to find out.
>
> Overall, though, it's better to avoid modal windows if possible. They
> can be frustrating or confusing to the user. Use sheets or modeless
> panels instead.
>
> ¡ªJens

Related mailsAuthorDate
mlwired things about NSApp Modal cai qin Feb 9, 03:50
mlRe: wired things about NSApp Modal Jerry Krinock Feb 9, 05:00
mlRe: wired things about NSApp Modal Nir Soffer Feb 9, 13:52
mlRe: wired things about NSApp Modal Jens Alfke Feb 10, 01:06
mlRe: wired things about NSApp Modal cai qin Feb 11, 21:27