The 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.
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
'*.pro'
or
'*.dat'
. 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 not 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 is set.
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 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 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.
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
. Enter: