On Tue, Aug 24, 2004 at 06:35:09AM -0400, Sherm Pendley wrote:
> On Aug 22, 2004, at 11:16 AM, Rick Frankel wrote:
>
> >I am trying to open a non-modal NSOpenPanel. As a simple test, I
> >modified the CamelBones FileViewer:
> >
> >$openPanel-
> >>beginForDirectory_file_types_modelessDelegate_didEndSelector_contextIn
> >fo(
> > $self->{'_openPath'}, '', $fileTypes, $self,
> > 'openPanelDidEnd:returnCode:contextInfo:', undef
> > );
>
> Have you tried passing undef as the 'file' argument? The docs say that
> it should either be the filename that is selected by default, or nil.
> An empty string is passed as exactly that, an NSString object with a
> length of zero; to pass nil, pass undef from Perl.
Yes, same results. The empty string is how the FileViewer example is
written and I was trying to make as few changes as possible.
However, I have found a solution:
$openPanel->runModalForTypes($fileTypes);
print STDERR "open: ",$openPanel->filename,"\n";
works.
thanx,
rick