Re: beginSheetForDirectory problem
Re: beginSheetForDirectory problem
- Subject: Re: beginSheetForDirectory problem
- From: Lil D <email@hidden>
- Date: Mon, 31 May 2004 12:48:14 -0400
Try this, change the didEndSelector in your openPanel method to look
like this:
@selector(openPanelDidEnd:returnCode:contextInfo:)
In other words...
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel beginSheetForDirectory:nil
file: nil
types:fileTypes // defined earlier
modalForWindow: [self window]
modalDelegate: self
didEndSelector:
@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo: nil];
On May 31, 2004, at 11:42 AM, email@hidden wrote:
Message: 15
To: email@hidden
From: Koen van der Drift <email@hidden>
Subject: beginSheetForDirectory problem
Date: Mon, 31 May 2004 11:04:18 -0400
Hi,
I am trying to use a sheet to open a file, and have added the following
code to MyWindowController:
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel beginSheetForDirectory:nil
file: nil
types:fileTypes // defined earlier
modalForWindow: [self window]
modalDelegate: self
didEndSelector:
@selector(openPanelDidEnd:)
contextInfo: nil];
and:
- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton)
{
// get stuff from file
}
}
The sheet opens, but when I dismiss it, openPanelDidEnd never gets
called.
Anyone sees what I did wrong?
thanks,
- Koen.
_______________________________________________
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.