Generic function
Displays the built-in directory dialog for the target platform.
choose-directory #key frame owner title documentation exit-boxes name default => locator
<frame>. Default value: #f.
<sheet>. Default value: #f.
<string>.
<string>.
<object>.
<object>.
<object>.
duim-sheets
duim-sheets
Displays the built-in directory dialog for the target platform, which allows the user to choose a directory from any of the local or networked drives currently connected to the computer.
If the frame argument is specified, the top-level sheet of frame becomes the owner of the dialog.
Alternatively, you can specify the owner directly using the owner argument, which takes an instance of <sheet> as its value.
By default, both frame and owner are #f, meaning the dialog has no owner. You should not specify both of these values.
If you wish, you can specify a title for the dialog; this is displayed in the title bar of the frame containing the dialog.
The following example illustrates how you can define a class of frame that contains a button that displays the Choose Directory dialog, using the pre-built dialog classes for your target environment.
define frame <directory-dialog-frame> (<simple-frame>)
pane dir-file-button (frame)
make(<menu-button>,
label: "Choose directory ...",
documentation:
"Example of standard 'Choose Dir' dialog",
activate-callback:
method (button)
let dir = choose-directory (owner: frame);
if (dir) frame-status-message(frame)
:= format-to-string
("Chose directory %s", dir);
end
end);
pane dir-layout (frame)
vertically ()
frame.dir-file-button;
end;
layout (frame) frame.dir-layout;
keyword title: = "Choose directory example";
end frame <directory-dialog-frame>;