Google

CCP4 web logo CCP4i: Graphical User Interface
Documentation for Programmers
SelectFile

next button previous button top button

NAME

SelectFile - Present user with file selection window.

SYNOPSIS

SelectFile fileout

Optional Arguments:

-title title_text
-unknown
-filter filter
-default filename
-defdir directory_alias
-format file_format
-parent parent_window

DESCRIPTION

Present the user with a file selection window and return the selected file as fileout. Return a value of 1 if a file selection is successful or 0 if the user fails to select a file. The default title for the file selection window is "File Selection" but this should be made more specific using the -title argument. SelectFile will expect the user to select an existing file unless the command -unknown is used to indicate that the name for a new file is expected. The -filter argument is usually used with a filter to select all files of a given extension (e.g. "*.mtz").

The contents of the file selection window can be initialised. By default the contents of the current directory (i.e. the directory in which the user started CCP4i) are displayed. The argument -defdir with a directory_alias will start the file selection window in the directory of the directory_alias. It is also possible to set an initial default value for the selected file or directory with the default argument and the name of the file or directory filename.

By default the file selection window does not have any option to view the selected file. If the -format argument is used with the expected format of the selected file file_format, then a 'View' button will appear, and if the user clicks on this button they will get a preview of the file using the FileViewer appropriate for the file format. The file formats are defined in the $CCP4I_top/ec/types.def file which is described in more detail here.

The -parent argument is used to input the id of the parent window parent_window of the file select window. If the user closes the parent window then the file select window will also be closed.

There are additional arguments to SelectFile but these are used in very specific parts of the interface and are unlikely to be generally useful.

KEYWORDS