my $types = NSMutableArray->alloc->init;
    $types->addObject('pod');
    $types->addObject('pm');
    $types->addObject('pl');

    my $panel = NSOpenPanel->openPanel;

if ($panel->runModalForTypes($types)) {


How do I get the open and/or save dialog to open at a specific directory? What I have tried has not worked.

That is pretty straightforward (it is explained in the Cocoa API documents for Objective C )


my $types = NSMutableArray->alloc->init;
    $types->addObject('pod');
    $types->addObject('pm');
    $types->addObject('pl');

    my $panel = NSOpenPanel->openPanel;

my $result = $panel->runModalForDirectory_file_types('/Applications/', undef,$types);

Shameless plug:

You can try out this kind of code very quickly using PerlPad.
http://perl-pad.sourceforge.net/

Just copy & paste the above lines into PerlPad and see your NSOpenPanel in action.
Much faster than a full compile cycle in ProjectBuilder.


Thilo



Reply via email to