Open NSSavePanel in windowDidLoad?
Open NSSavePanel in windowDidLoad?
- Subject: Open NSSavePanel in windowDidLoad?
- From: David Faden <email@hidden>
- Date: Sun, 28 Mar 2004 03:55:09 -0600
Hi,
Is there anything wrong with opening an NSSavePanel in an
NSWindowController's windowDidLoad method? When I try to do so, the
NSSavePanel flashes open and then disappears. The panel opens in a
space noticeably to the right of where it should be appearing. My code
is simply as follows:
- (void)windowDidLoad
{
[progressIndicator setMinValue:0];
[progressIndicator setMaxValue:numberOfFrames];
[progressIndicator setDoubleValue:0];
[frameCompletedField setStringValue:@"No frames completed"];
[[NSSavePanel savePanel] beginSheetForDirectory:@""
file:@"Untitled.mov"
modalForWindow:[self window]
modalDelegate:self
didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:)
contextInfo:NULL];
}
The reason I'm opening the panel here is that I want to prompt the user
for a file name as soon as the window is shown. (I have also tried
using NSWindow delegate methods for this but they seem not to be called
at all. savePanelDidEnd:returnCode:contextInfo: is not called when the
panel shown above flashes out of view.)
As far as I can tell, everything is properly connected. Log statements
in the above show [self window] not to be nil. And the window
associated with the NSWindowController does appear to be displayed
properly.
After the first save panel vanishes, attempts to open other save panels
on the window (by the action of a button in the window) result in beeps
from the system.
Can anyone shed some light on what I'm doing wrong? Thank you.
Please CC responses to me as well as the list.
David
AIM: pitulx
_______________________________________________
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.