Re: Disappearing main window
Re: Disappearing main window
- Subject: Re: Disappearing main window
- From: Frank Midgley <email@hidden>
- Date: Tue, 27 Jan 2004 16:26:40 -0600
On Jan 25, 2004, at 2:36AM, Chad Armstrong wrote:
I'm encountering an odd problem with save panels and drop down sheets.
I have a save panel appear, and once the OK button is pressed, it
continues onto the savePanelDidEnd function. Within this function I
want to call another drop down sheet to show the progress of the
program running. The sheet will appear, but the main window
disappears! After the program is done running, the main window is no
longer visible. If I bring back the window by right-clicking on the
icon on the Dock and 'resurrecting' the window, the window is only
partially drawn. There is a big square chunk which isn't drawn, just
where the last drop down sheet was.
This is an odd problem. Does anyone know why this is happening? I
have narrowed down the problem that this is occurring when I try to
open up the new sheet in the savePanelDidEnd function.
Since the save panel callback is a sheetDidEnd and not a
sheetDidDismiss the sheet is still up in your delegate method. If you
then call up another sheet NSApp gets confused. The trick is to get
the first sheet fully dismissed before popping up the next. I
typically create another method that opens the next sheet and call that
one in the sheetDidEnd via [self performSelector:@selector(newMethod)
withObject:nil afterDelay:0.0]. This allows the sheet to dismiss and
then pops up the next one. There is probably a more elegant solution,
but this works.
-Frank
------------------------------------
Frank M. Midgley
email@hidden
http://homepage.mac.com/knarf/
_______________________________________________
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.