10.6 GUI InterfacesThe screen shots and explanation for this section were supplied by Steve Kirkendall. We thank him. elvis 's X11 interface provides a scrollbar and mouse support, and allows you to select which fonts to use. There is no way to change fonts after elvis has created the first window. The fonts must all be monospace fonts, typically some variation of a Courier or "fixed" font. elvis 2.0's X11 interface supports multiple fonts and colors, a blinking cursor that changes shape to indicate your editing mode (insert vs. command), a scrollbar, and mouse actions. The mouse can be used for selecting text, cutting and pasting between applications, and performing tag searches. elvis
2.1 adds a configurable toolbar,
dialogue windows, a status bar,
and the Because elvis 2.1 has a significantly improved X11 interface over 2.0, and because it should be released by the time this book is published, details in the rest of this section apply to it. A number of features, several command-line options, and the ability to configure elvis via X resources are all missing from Version 2.0. 10.6.1 The Basic WindowThe basic elvis window is shown in Figure 10.1 . Figure 10.1: The elvis GUI windowelvis provides a separate text search pop-up dialogue box, which is shown in Figure 10.2 . Figure 10.2: The elvis search dialogueThe look and feel are intended to resemble Motif, but elvis doesn't actually use the Motif libraries. Command-line options let you choose the four different fonts that elvis uses, normal, italic, bold, and "control," which is the font for the toolbar text and button labels. You may also specify foreground and background colors, the initial window geometry, and whether elvis should start out iconified.
The new Besides the toolbar, there is also a status bar that displays status messages and any available information about toolbar buttons. 10.6.2 Mouse BehaviorThe mouse behavior tries to strike a balance between xterm (1) and what makes sense for an editor. To do this correctly, elvis distinguishes between clicking and dragging. Dragging the mouse always selects text.
Dragging with button 1 pressed (usually the left button) selects characters,
dragging with button 2 (the middle button) selects a rectangular area, and
dragging with button 3 (usually the right button) selects whole lines.
These operations correspond to elvis
'
Clicking button 1 cancels any pending selection, and moves the cursor to the clicked-on character. Clicking button 3 moves the cursor without canceling the pending selection; you use this to extend a pending selection. Clicking button 2 "pastes" text from the X11 cut buffer (like xterm ). If you're entering an ex command line, the text will be pasted into the command line as though you had typed it. If you're in visual command mode or input mode, the text will be pasted into your edit buffer. When pasting, it doesn't matter where you click in the window; elvis always inserts the text at the position of the text cursor. Double-clicking button 1 simulates a 10.6.3 The Toolbar
The X11 interface supports a user-configurable toolbar.
By default, the toolbar is enabled unless your
~/.exrc
file has a
The default toolbar already has some buttons defined.
You use the There are a number of commands. In particular, you can reconfigure the toolbar to suit your tastes, deleting one or all of the existing buttons, adding new ones, and controlling the spacing between buttons or groups of buttons. Here is a simple example: :gui Make:make :gui Make " Rebuild the program :gui Quit:q :gui Quit?!modified
These commands add two new buttons. The first line
adds a button named "Make," which
will execute the
The second button, named "Quit," is created by
the third line. It exits the
program. The fourth line changes its behavior.
If the condition ( You can create pop-up dialogues that appear when a toolbar
button is pressed. The dialogue can set the value(s) of
pre-defined variables (options) that can then be tested from
the ex
command associated with the button.
There are 26 pre-defined variables, named
:gui Split"Create a new window, showing a given file :gui Split;"File to load:" (file) f = filename :gui Split:split (f)
The first command associates descriptive text with the "Split"
button. The second command creates the pop-up dialogue: its prompt
is File to load:
and it will set the The facility is quite flexible; see the online help for the full details. 10.6.4 Options
A large number of options control the X11 interface.
You typically set these in your .exrc
file. There are options and abbreviations for setting the
various fonts, enabling and configuring the toolbar, status bar,
scrollbars, and the cursor.
Other options control the cursor's behavior when
you switch windows with The online documentation describes all of the X11-related ex options. Here, we describe some of the more interesting ones:
elvis
2.1 adds the ability to be configured via
X resources.
The resource values can be overridden by command-line flags, or by
explicit
The "Timeout" type gives a time value, in tenths of a second.
The "Edge" type gives a scrollbar position,
one of For example, if your X resource database contains the line
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|