• 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: How to catch modal window appearance?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to catch modal window appearance?


  • Subject: Re: How to catch modal window appearance?
  • From: Lee Ann Rucker <email@hidden>
  • Date: Mon, 29 Mar 2010 13:27:25 -0700


On Mar 27, 2010, at 1:23 AM, Alexander Bokovikov wrote:

On 27.03.2010, at 12:48, Ken Thomases wrote:

I'm not really sure what you're asking for.  A modal window being
shown on screen is not something that happens spontaneously _to_
your application, it's something that your application does.  So,
whatever you want to do after the window is shown, just do it after
the point in your code where you show it.

I tried to achieve the next effect: some automatic process should be started on the modal window appearance on screen. A popup panel with progress indicator appears, etc. My idea was not to initiate such process from the calling code (where modal window is called from), but do it asynchronously, as soon as the modal window will appear on the screen.

Of course, I've solved the problem by calling this process from the
calling code just before [NSApp runModalForWindow:] call. But it is
not pretty correct from the OOP philosophy point of view, at least as
I understand it.


Well, if you're using runModalForWindow: and relying on it to show the window, it goes away before the method returns, so there is no point in the code after show and before hide.


But you can always do makeKeyAndOrderFront: explicitly:

[myWindow makeKeyAndOrderFront:self];
// Stuff I need to do
[NSApp runModalForWindow:myWindow].

_______________________________________________

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


  • Follow-Ups:
    • Re: How to catch modal window appearance?
      • From: Alexander Bokovikov <email@hidden>
References: 
 >How to catch modal window appearance? (From: Alexander Bokovikov <email@hidden>)
 >Re: How to catch modal window appearance? (From: Fritz Anderson <email@hidden>)
 >Re: How to catch modal window appearance? (From: Alexander Bokovikov <email@hidden>)
 >Re: How to catch modal window appearance? (From: Ken Thomases <email@hidden>)
 >Re: How to catch modal window appearance? (From: Alexander Bokovikov <email@hidden>)

  • Prev by Date: Re: Removing Object form ArrayController without managedObjectContext
  • Next by Date: AppleScriptability Meets NSOperation
  • Previous by thread: Re: How to catch modal window appearance?
  • Next by thread: Re: How to catch modal window appearance?
  • Index(es):
    • Date
    • Thread