Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2004



Tip: Looking for answers? Try searching our database.

Multiple modal dialog sessions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joern - 29 Oct 2004 12:45 GMT
Hi,

in my application I start running a modal session for a dialog using
[NSApplication runModalForWindow]. This works fine, but when I click on
a button in this dialog, another modal dialog comes up and here  is my
problem. The second modal dialog is the only dialog the accepts user
input, such as clicking lists or entering text. However, if I click on
the first modal dialog (which is in background now) the dialog comes to
front and covers the second dialog which runs the current modal session.

Did I forget to set any flags for the windows to prevent this from
happening?

Thanks in advance.

 - Jörn
Michael Ash - 29 Oct 2004 15:47 GMT
> Hi,
>
[quoted text clipped - 8 lines]
> Did I forget to set any flags for the windows to prevent this from
> happening?

First, let me address the user-interface issues with this approach. It's
generally a bad idea to start a modal dialog from another modal dialog.
Try to avoid it if at all possible. You could, for example, use a sheet
together your input, or something else like that. Even better would be
some kind of modeless input mechanism. Forcing the user to provide input
before he can do anything else with your program is to be avoided if at
all possible.

On to the technical aspect, if you decide you want to keep this interface
anyway. I'm guessing there's some problem having two modal sessions going
at the same time. You should probably stop your "outer" one before
starting the "inner" one, and then restart it once you're done.
David C. Stone - 29 Oct 2004 18:26 GMT
> > Hi,
> >
[quoted text clipped - 21 lines]
> at the same time. You should probably stop your "outer" one before
> starting the "inner" one, and then restart it once you're done.

Try hiding the first dialog for as long as the second one is active.

Alternatively, just make them both exactly the same size and appear
at exactly the same screen coordinates!

A long, long time ago I actually did something similar with modal
dialogs, but that was for OS 7.  That avoided the "click in the
other modal" problem by intercepting all mouse clicks in the modal
dialog event proc.  I have no idea if that's at all relevant to
your situation, but strongly suspect it isn't given the substantial
differences between then and now...
Miro Jurisic - 29 Oct 2004 20:32 GMT
> Try hiding the first dialog for as long as the second one is active.
>
> Alternatively, just make them both exactly the same size and appear
> at exactly the same screen coordinates!

I am having trouble deciding which of these two "solutions" would make me gag
first. They are both terrible UI.

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.