> Hi,
>
[quoted text clipped - 7 lines]
> Since CamelBones just wraps around the Objective-C functions, you can
> use the documentation for that.
Sometimes that works, sometimes it does not. It seems that a lot of
trial and error is involved.
> For starters, you can do something like this:
>
[quoted text clipped - 13 lines]
>
> There is also NSSavePanel to save files (rather than open them).
BTW, this example is much more to the point than those in the example
programs. Much more commented as well. (The examples assume that you
are already proficient at Cocoa and Objective-C.)
> If you want to filter for specific files types you can do:
>
[quoted text clipped - 6 lines]
>>
>> 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.
Thilo Planz - 04 Aug 2004 01:43 GMT
>>> my $types = NSMutableArray->alloc->init;
>>> $types->addObject('pod');
[quoted text clipped - 7 lines]
> 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');
[quoted text clipped - 5 lines]
> 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