The library library(find_file)
defines the class finder, representing a modal dialog window for
entering a filename. This class defines the method `finder<-file':
pl
and '.pl' are valid specifications of files ending in
'.pl'. Dir is the directory to start from. When
omitted, this is the last directory visited by this instance of finder
or the current working directory. Def is the default
file-name returned. When omitted there is no default.
Below is the typical declaration and usage. In this example we ask for an existing Prolog file.
:- pce_autoload(finder, library(find_file)).
:- pce_global(@finder, new(finder)).
...,
get(@finder, file, @on, pl, PlFile),
...,
The Windows version of XPCE
implements the method
`display<-win_file_name',
using the Win32 API standard functions GetOpenFileName() or
GetSaveFileName() to obtain a file-name for saving or loading. If this
method is defined, `finder<-file'
uses it, showing the users familiar dialog.
Names for the extensions (as `Prolog file' rather than '*.pl') can be defined by extending the multifile predicate pce_finder:file_type/2. See the library source for the standard definition.