• 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: Running a modal session
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running a modal session


  • Subject: Re: Running a modal session
  • From: Stéphane Sudre <email@hidden>
  • Date: Thu, 22 Apr 2004 12:15:10 +0200

On 22 avr. 2004, at 12:03, Michael Becker wrote:

Hello!

I have a window, where I programmatically change the contentViews, depending on the buttons clicked by the user (it's a wizard-like "back" and "next" thing). Now I want this window to be a modal window for my application. When the window is first opened, it displays a progress indicator while the application connects to a server. When it is connected, it should display the following contentView.
However:

If I use "[NSApp runModalForWindow:[ self window]];" the window is modal (that is, a click in the main application window results in nothing but a "pling" sound, which is exactly what I want), but the application will keep showing the spinning progress indicator. Most obviously this is so, because the code to show the next contentView is not directly associated to the window.

And if I set up a session like that:
session = [NSApp beginModalSessionForWindow:[ self window]];
[ NSApp runModalSession:session];
everything works fine, except that I can now still click and operate on my main application window, which stays in the background.

I hope that it is pretty clear what I want to achieve ("wizard"-like view-flipping without being able to click around in the main application window). What is the best way to do this?

I'm wondering if the issue is not that your 'connection success' event is not sent to the controller because the modal dialog is filtering the events.

So it might be worth having a look at NSEvent and NSRunLoop to see if there's a way to modify the event mask or forward events to the controller.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Running a modal session (From: Michael Becker <email@hidden>)

  • Prev by Date: Running a modal session
  • Next by Date: Adding table columns with image cells - the problem
  • Previous by thread: Running a modal session
  • Next by thread: Adding table columns with image cells - the problem
  • Index(es):
    • Date
    • Thread