Sheets/modal problem
Sheets/modal problem
- Subject: Sheets/modal problem
- From: Matt Ridley <email@hidden>
- Date: Sat, 23 Jun 2001 13:35:09 +0100
Hi again all,
I'm having a problem with a modal dialog and a sheet. The situation is as
follows: I have a main window in my app, and the ability to open a modal
dialog in front of that main window. My modal dialog is a panel, and I run
it modally with this code:
[myPanel makeKeyAndOrderFront:nil];
[NSApp runModalForWindow:myPanel];
[myPanel orderOut:nil];
Now, in certain circumstances, I need to display a sheet (an alert sheet)
within my modal dialog. I do this using the function: NSBeginAlertSheet(),
which is defined in the Functions section of the AppKit documentation.
All works as needed. However, when my alert sheet is displayed in my modal
dialog, there are two unwanted effects:
- my modal dialog itself becomes visually disabled.
- my main window (behind the modal dialog) is no longer disabled!
I'm a lot more worried about the second effect. I need my main window to
remain disabled as long as my modal dialog is on screen, and this worked
fine up until I added the sheet. Whenever the sheet shows, the main window
becomes accessible to the user again - which I definitely don't want.
Is there a way to achieve what I need - to keep the main window disabled
whilst showing the alert sheet on my modal dialog?
Thanks once again. Not sure what I'd do without this list. :-)
--
// Matt
- (void)contactMatt { // Contact Information ===============
if ([via email]) send = @"
mailto:email@hidden ";
else if ([via wwweb]) goto = @"
http://www.scotlandsoftware.com/ ";
} // ===================================