Change the text of an NSOpenPanel button

I use NSOpenPanel to select a folder by the user, where I can programmatically copy some files.

NSOpenPanel *panelOpen = [NSOpenPanel openPanel];
        [panelOpen setMessage:@"Please select a location to save file(s)."];
        [panelOpen setCanChooseDirectories:YES];
        [panelOpen setCanCreateDirectories:YES];

The Open dialog box opens using the Open button. I want to change the button text to "Select" or "Select" instead of "Open."

Is it possible?

+4
source share
2 answers

As you can see from the documentation - pay attention to NSSavePanelwhich NSOpenPanel inherits.

You can use setPrompt:for what you want to achieve.

+8
source

setPrompt:, NSOpenPanel NSSavePanel.

+1

Source: https://habr.com/ru/post/1534595/


All Articles