• 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: wired things about NSApp Modal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wired things about NSApp Modal


  • Subject: Re: wired things about NSApp Modal
  • From: "cai qin" <email@hidden>
  • Date: Mon, 11 Feb 2008 12:27:18 -0800

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

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@hidden>:
>
>
> 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
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >wired things about NSApp Modal (From: "cai qin" <email@hidden>)
 >Re: wired things about NSApp Modal (From: Jens Alfke <email@hidden>)

  • Prev by Date: Here is code to Convert RGB <-> HSB
  • Next by Date: Re: [ANN] New Core Data Tutorials
  • Previous by thread: Re: wired things about NSApp Modal
  • Next by thread: What's the replacement for GetMBarHeight?
  • Index(es):
    • Date
    • Thread