Sheets and Modals for dialogs
Sheets and Modals for dialogs
- Subject: Sheets and Modals for dialogs
- From: "Huyler, Christopher M" <email@hidden>
- Date: Fri, 5 Dec 2003 16:21:13 -0500
- Thread-topic: Sheets and Modals for dialogs
I'm still new with Cocoa so bare with me...
I have created a dialog that displays the status of a command running in
a separate thread. The thread sends back the status of the command so
that the main event loop can update a TextField and a ProgressIndicator.
I would like to open this dialog as a sheet so that the user cannot
touch anything in the main window, however, when I do that, nothing
inside the dialog gets updated (because the main event loop is waiting
for the sheet to return). Here are two snippits of code to describe
what I'm trying to do:
/* as a sheet */
[NSApp beginSheet:myWindow
modalForWindow:[serviceButton window]
modalDelegate: NULL
didEndSelector: NULL
contextInfo: NULL];
[NSApp runModalForWindow:myWindow];
/* wait for runModalForWindow to return */
...
[NSApp endSheet:myWindow];
[sheet orderOut:self];
/* as a window */
NSModalSession session;
session = [NSApp beginModalSessionForWindow:myWindow];
[NSApp runModalSession:session];
...
[NSApp endModalSession:session];
Is there a way to get the session-style behavior in a sheet? If not, how
can I update the contents of myWindow when it is displayed as a sheet?
--
Christopher Huyler
Computer Associates Intl.
mailto:email@hidden
_______________________________________________
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.