The code I wrote does indeed set that attribute to true but ⌘ A is not
working. Here's my MCV example that does everything except allow me to
select all items. BTW, if I use "true" instead of "YES", then it behaves
the same way.

Multiple selections work but it won't let me select all. I would have
expected select all to work even in the context below.

#import <Cocoa/Cocoa.h>

void openDialog () {
    @try {
        NSOpenPanel *panel = [NSOpenPanel openPanel];
        [panel setCanChooseFiles:YES];
        [panel setCanChooseDirectories:YES];
        [panel setAllowsMultipleSelection:YES];
        if ([panel runModal] == NSModalResponseOK) {
            for ( NSURL* URL in [panel URLs] ) {
                NSLog( @"%@", [URL path] );
            }
        } else {
            NSLog( @"ok button not pressed");
        }
    } @catch (NSException *exception) {
        NSLog(@"%@", [exception callStackSymbols]);
    }
}

void setup () {
    NSWindow *myWindow;
    NSRect    graphicsRect = NSMakeRect(100.0, 350.0, 400.0, 400.0);

    myWindow = [ [NSWindow alloc]
               initWithContentRect: graphicsRect
                         styleMask:NSWindowStyleMaskTitled
                                  |NSWindowStyleMaskClosable
                                  |NSWindowStyleMaskMiniaturizable
                           backing:NSBackingStoreBuffered
                             defer:NO ];

    [myWindow setTitle:@"Open File App"];
    [myWindow makeKeyAndOrderFront: nil];
openDialog();
}

int main (  ) {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSApp = [NSApplication sharedApplication];
    setup();
    [NSApp run];
    [NSApp release];
    [pool release];
    return(EXIT_SUCCESS);
}

On Wed, Jan 31, 2024 at 7:01 PM Yee Cheng Chin <ychin.mac...@gmail.com>
wrote:

> It's done in MMAppController.m's fileOpen: method. I think you just need
> to enable "allowsMultipleSelection" (
> https://developer.apple.com/documentation/appkit/nsopenpanel/1530786-allowsmultipleselection)
> if you are trying to debug your own app.
>
> On Wed, Jan 31, 2024 at 2:00 PM Jeff Holt <jeffrey.l.h...@gmail.com>
> wrote:
>
>> I'm looking at the source for the fileOpen method and I cannot figure out
>> how it tells NSOpenPanel to respect ⌘A to select all files in the dialog.
>>
>> Does anyone know how it's done?
>>
>> --
>> --
>> You received this message from the "vim_mac" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "vim_mac" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to vim_mac+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/vim_mac/f959c994-3e15-4184-accf-8163bea9ccd2n%40googlegroups.com
>> <https://groups.google.com/d/msgid/vim_mac/f959c994-3e15-4184-accf-8163bea9ccd2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> --
> You received this message from the "vim_mac" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_mac" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_mac+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_mac/CAHTeOx8Gx0QUNe80EKXuxqRdBqTffH%2B5H_kgWoLy9KyO6P4LvQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/vim_mac/CAHTeOx8Gx0QUNe80EKXuxqRdBqTffH%2B5H_kgWoLy9KyO6P4LvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/CAChzgUffE0b66SR2X5WYbqo9Wjx9QRSsWoQQpS8QYEDqZd54iw%40mail.gmail.com.

Reply via email to