DIALOG_PICKFILE function allows the user to i
nteractively pick a file using the platform's own native graphical file-selection dialog. The user can also enter the name of a file that does not exist (see the description of the WRITE keyword, below). DIALOG_PICKFILE returns a string that contains the full path name of the selected file. If no file is selected, DIALOG_PICKFILE returns a null string.
Result = DIALOG_PICKFILE()
Set this keyword to display only the existing directories in the current directory. Individual files are not displayed.
Set this keyword equal to a string that specifies the name of the X Windows display on which the dialog should be displayed. This keyword is ignored on Microsoft Windows and Macintosh platforms.
Set this keyword to a scalar string that contains the name of the initial file selection. This keyword is useful for specifying a default filename.
A string value for
filtering the files in the file list. This keyword is used to reduce the number of files to choose from. The user can modify the filter unless the FIX_FILTER keyword is set. Example filter values could be
. Only a single filter condition is allowed.
Under Microsoft Windows, the user cannot modify the filter. (The user can, however, enter a filter string in the filename field to filter the files displayed.)
On the Macintosh, the filter is not displayed if the WRITE keyword is set.
When this keyword is set, only files that satisfy the filter can be selected. The user has no ability to modify the filter and the filter is not shown.
Under Microsoft Windows, the user cannot modify the filter even if FIX_FILTER is
set. Note that the user can enter a filter string in the filename field of the dialog to change the filter condition even if FIX_FILTER
Set this keyword to a named variable in which the path of the selection is returned.
The widget ID of a widget that calls DIALOG_PICKFILE. When this ID is specified, a death of the caller results in the death of the DIALOG_PICKFILE dialog.
Set this keyword to allow only files that already exist to be selected.
Set this keyword to a string that contains the initial path from which to select files. If this keyword is not set, the current working directory is used.
Set this keyword to make the title of the dialog "Select File to Read".
Set this keyword to a scalar string to be used for the dialog title. If it is not specified, the default title is "Select File". This keyword is ignored on Macintosh platforms.
Set this keyword to make the title of the dialog "Select File to Write".
On the Macintosh, you
set the WRITE keyword in order to be able to enter the name of a file that does not exist. As a result, the FILTER and FIX_FILTER keywords are ignored when the WRITE keyword is specified on a Macintosh.
Create a DIALOG_PICKFILE dialog that lets users select only files with the extension `pro'. Use the `Select File to Read' title and store the name of the selected file in the variable
file = DIALOG_PICKFILE(/READ, FILTER = '*.pro')