Re: prob a silly question
Re: prob a silly question
- Subject: Re: prob a silly question
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 5 Sep 2001 18:35:28 +0200
On mercredi, septembre 5, 2001, at 04:40 PM, Robert S Goldsmith wrote:
Hi :)
prob a silly question but I can't find the answer:
In the
[NSOpenPanel beginSheetForDirectory: file: types: modalForWindow:
modalDelegate: didEndSelector: contextInfo:]
call, I figure didEndSelector is the method to handle the users
selection when they click ok or cancel. But what does the modalDelegate
do?
modalDelegate is the target of the didEndSelector message.
I'm still getting the hang of delegates as it is. This one does not
seem to have any use. Is not the window just locked, the modal panel
displayed and the result passed to the didEndSelector method?
A sample code:
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
[oPanel setAllowsMultipleSelection:NO];
[oPanel setCanChooseDirectories:YES];
[oPanel setCanChooseFiles:NO];
[oPanel setPrompt:NSLocalizedString(@"Select",@"No comment")];
[oPanel beginSheetForDirectory: NSHomeDirectory() file:nil
modalForWindow:[IBlogPeriodMatrix_ window] modalDelegate:self
didEndSelector:@selector(selectLogExportFolderDidEnd:returnCode:contextInfo:
) contextInfo:nil];