FunctionPackage: common-graphicsToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
Unrevised from 6.1

files-to-list-box

Arguments: list-box directory-string &key static-text read-write-p read-only-p hidden-p system-p archive-p directory-p drive-p current-directory-p

Use of this function is deprecated

This function is hooked directly into older Windows functionality for listing the files of a directory into a list-box control (a single-item-list, multi-item-list, or combo-box). This functionality does not handle long file names, and was somewhat awkard to use. It is more straightforward to simply call directory to find the files that are in a directory, and then call (setf range) on the control to list the files there. Subdirectories only may be shown by including only those files for which file-directory-p returns true.

For example, suppose the value of *my-single-item-list* is a single-item-list on a dialog. We make the on-print method print pathname objects with the filename, and set the range of *my-single-item-list* to the list returned by directory:

(defun my-sil-on-print (item)
  (if (pathnamep item) (pathname-name item) item))

(setf (on-print *my-single-item-list*) #'my-sil-on-print)

(defun display-dir-in-sil (dir)
  (declare (special *my-single-item-list*))
  (setf (range *my-single-item-list*) (directory dir)))

This is the general function to display contents of a directory in a list-box control. The two required arguments are a list-box in which to display the directory contents, and a string naming the directory to display. The directory-string can be either a complete pathname namestring with * & ? wildcard characters, or a directory namestring either ending in a backslash or not. It should not be a complete namestring of a single file with no wildcard characters.

If a static-text widget is passed for the :static-text keyword argument, then the directory name itself will be displayed in that (second) widget.

Each of the other keyword arguments determines whether that type of file (or subdirectory) should be included in the list. So by default ordinary read-write files are the only type included. :directory-p means to include subdirectories of the named directory; :drive-p means to include drive letters for each disk drive on the machine other than the drive of the named directory; :current-directory-p means to include a [.] entry for the named directory itself.


Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. This page was not revised from the 6.1 page.
Created 2002.2.26.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
Unrevised from 6.1