Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change NSOpenPanel button text

I am using NSOpenPanel to select the folder by the user where I can copy some files programatically.

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

This opens the Open dialog with the button "Open". I want to change the button text to "Choose" or "Select" instead of "Open".

Is this possible?

like image 412
Ramaprasad Upadhyaya Avatar asked Apr 02 '14 06:04

Ramaprasad Upadhyaya


2 Answers

As clearly visible from the documentation - note look into NSSavePanel which NSOpenPanel inherits from.

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

like image 189
Volker Avatar answered Oct 29 '22 20:10

Volker


You are looking for setPrompt: provided by NSOpenPanel's superclass NSSavePanel.

like image 42
CRD Avatar answered Oct 29 '22 21:10

CRD