tags:

views:

31

answers:

2

Now I clicked a button in the mainwindow and show a modal window ,then in the modal I clicked a button to show another modal window , now I found When I closed the top modal window ,the focus didn't in the next level modal window , I open the modal window used the func: [NSApp runModalForWindow: ]; How to let the focus in the next level modal window when closed the top level modal window?

+1  A: 

As a rule, you shouldn't really be running modal sessions inside modal sessions. Not only is it really bad UI, it's quite complex to get right.

Have a look at Apple's modal session documentation for detailed information on modal sessions: http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingModalWindows.html

iKenndac
A: 

But the top level window is a customized Alert panel. When I closed the panel , whnich method can make me to let the focus in the next modal level?

jin