Re: Widgets turning white and never unturning white?
Re: Widgets turning white and never unturning white?
- Subject: Re: Widgets turning white and never unturning white?
- From: "Theodore H. Smith" <email@hidden>
- Date: Thu, 14 Jul 2005 09:23:53 +0100
On 8 Jul 2005, at 00:17, glenn andreas wrote:
On Jul 7, 2005, at 4:32 PM, Theodore H. Smith wrote:
I'm trying to get some window saving.
So, I call the very long named
beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelect
or:contextInfo:
and then call runModalForWindow: right after that.
You're not suppose to do that - you're basically making two nested
modals (with the same window) which, as you've seen, is a bad thing
to do (since while the first modal loop is exits, it gets rid of
the window for which the sheet should be run, so it isn't shown,
but can't be dismissed).
Use either sheets (which are document modal) or runModal, but not
both.
Hi Glenn,
I got around to looking at this:
[sheet beginSheetForDirectory:nil
file:name
modalForWindow:window
modalDelegate:self
didEndSelector:@selector
(savePanelDidEnd:returnCode:contextInfo:)
contextInfo:cfd
];
assert( true ); // just set a breakpoint here.
The open dialog fires, and then the breakpoint is trapped
immediately, even before I closed the dialog!
However, if I do this code:
[sheet beginSheetForDirectory:nil
file:name
modalForWindow:window
modalDelegate:self
didEndSelector:@selector
(savePanelDidEnd:returnCode:contextInfo:)
contextInfo:cfd
];
[NSApp runModalForWindow:sheet];
assert( true ); // just set a breakpoint here.
The breakpoint only files when the dialog closes.
So, I still haven't heard how I can call a proper modal sheet dialog.
You said that I've nested two modals, but that's not possible? After
all, one modal happens, and all code flow stops until that modal is
closed.
I'm a bit unsure about how to get modal sheets.
Must I install a busy loop or some kind of sleep or 'wait-until' code
to stop the code flow from moving past "beginSheetForDirectory"?
Something like:
while (NotGotAnswerFromSheet()) {
SleepForOneTick();
}
I'm assuming that Cocoa has a much cleaner solution than that nasty
suggestion I made :)
--
http://elfdata.com/plugin/ Industrial strength string processing,
made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden