Camelbones help

Matts on 2007-05-30T01:04:40

Any camelbones hackers read here?

I need a directory open dialog in my camelbones app. It should be as easy as:



my $panel = NSOpenPanel->openPanel(); NSLog("Panel: $panel\n"); $panel->setCanChooseDirectories(1); $panel->setCanChooseFiles(0); my $ret = $panel->runModalForTypes(undef);
But this segfaults. As does runModalForDirectories_file_types().

Any ideas?


File open

garth on 2007-05-30T08:55:07

Not sure why this works, but if you do:

        my $panel = NSOpenPanel->openPanel();
        $panel->setCanChooseDirectories(1);
        $panel->setCanChooseFiles(0);
        my $fileTypes = undef;

        my $ret = $panel->runModalForTypes($fileTypes);

it doesn't seem to crash. Not sure if it is correct though, because then it isn't letting me select any file types.

I have had a few issues trying to pass nil to methods and I am never sure if undef is the right way.

Re:File open

Matts on 2007-05-30T13:29:08

You rock star!

Now I can finish my app :-)