The Load Window

The xv load window lets you load and view images interactively, without specifying them on the command line when you start xv . While it has been made somewhat obsolete by the Visual Schnauzer, the xv load window is considerably quicker.

The load window shows the contents of the current directory in a scrolling window. The files will be sorted alphabetically, with a small icon for each indicating the type of file (directory, executable, or normal file).

This list window operates in the same way that the one in the xv controls window works. (See "Operating a List Window" for details.) In short, you can operate the scroll bar, drag the highlight bar around the window, and use the <Up>, <Down>, <Home>, <End>, <PageUp>, and <PageDown> keys on your keyboard.

Whenever you click on a name in the list (or otherwise change the position of the highlight bar), the name of the highlighted file is copied to the "Load file" text entry region, located below the list window. Pressing the Ok button (or hitting <Return> ) will make xv attempt to load the specified file. If the load attempt is successful, the load window will disappear, and the new image will be displayed. Otherwise, an error message will be displayed, and the load window will remain visible.

The Browse checkbox overrides this behavior, and keeps the load window visible until explicitly closed (via the Cancel button). This is handy if you're using xv to 'wander around a directory tree', and plan to be using the Load command quite often. (Though a better way would probably involve using the Visual Schnauzer.)

If the image is successfully loaded, its name will be added to the xv controls window list. This will let you quickly reload it later without have to go through the xv load window again.

You can also load a file by double-clicking on its name in the file list.

If the specified filename begins with a '!' or '|' character, the filename will be interpreted as a shell command to run. The leading '!' or '|' is dropped, and the rest of the line is fed to the default system shell. The command is expected to generate an image in one of the xv -recognized formats as its standard output. If the command returns non-zero, xv assumes it failed, and doesn't try to read the output produced. You can pipe multiple commands together. For example loading "! xwd | xwdtopnm" would run xwd to generate a window dump, pipe that to xwdtopnm to convert it to a PPM file, and that file would be piped to xv. Which, as examples go, made a lot more sense back before xv was able to read XWD files directly.

If the specified file is a directory, xv will figure that out and (instead of loading it) will cd to that directory, and display its contents in the list window.

Above the list window is a pop-up menu button. It normally displays the name of the current directory. If you click this button, and hold the mouse down, the complete path will be shown, one directory per line. You can go 'up' the directory tree any number of levels, all the way up to the root directory, by simply selecting a directory name in this list.

For those who prefer the direct approach, you can simply type file or directory names in the "Load file" text entry region. If you type a directory name and hit <Return>, xv will cd to that directory and display its contents in the list window. If you type a file name and hit <Return>, xv will attempt to load the file. You can enter relative paths (relative to the currently displayed directory), absolute paths, and even paths that begin with a '~'.

The "Load file" text entry region supports a number of emacs-like editing keys:

<Ctrl> f
moves the cursor forward one character
<Ctrl> b
moves the cursor backward one character
<Ctrl> a
moves the cursor to the beginning of the line
<Ctrl> e
moves the cursor to the end of the line
<Ctrl> d
deletes the character to the right of the cursor
<Ctrl> u
clears the entire line
<Ctrl> k
clears from the cursor position to the end of the line.
<Tab>
Filename completion. Note: it can only complete 'simple' filenames (no '/' chars)

If the filename is so long that it cannot be completely displayed in the text entry region, a thick line will appear on the left or right side (or both sides) of the region to show that "there's more over this way".

Pressing the Rescan button will rescan the current directory. While the contents of the current directory are read each time the load window is opened, it is perfectly possible (given a multitasking operating system) that some other program may add, delete, or rename files in the current directory. xv would not know if this happened. The Rescan button gives you an easy way of 'kicking' xv into looking again.
 
The Load All button simply copies the names of all 'plain files' found in the current directory into the xv controls filename list, where you have the Next and Prev buttons to help you look at a list of files.