Previous Section Next Section Table of Contents Glossary Index

Chapter 6. Hemlock Programming

6.10. Controlling the Display

6.10.1. Views

A hemlock-view represents the GUI object(s) used to display the contents of a buffer. Conceptually it consists of a text buffer, a modeline for semi-permanent status info, an echo area for transient status info, and a text input area for reading prompted input. (Currently the last two are conflated, i.e. text input happens in the echo area).

The API for working with hemlock-views is not fully defined yet. If you need to work with views beyond what's listed here, you will probably need to get in the sources and find some internal functions to call.

6.10.2. The Current View

[Function]

current-view

Description:

current-view returns the hemlock view which is the target of the currently executing command. This is usually the frontmost hemlock window in the current application.

6.10.3. View Functions

[Function]

hemlock-view-p object

Description:

This function returns t if object is a hemlock view, otherwise nil.

[Function]

hemlock-view-buffer view

Description:

This function returns the buffer which is displayed in the view.

6.10.4. Cursor Positions

[Function]

mark-column mark

Description:

This function returns the X position at which mark would be displayed, supposing its line was displayed on an infinitely wide screen. This takes into consideration strange characters such as tabs.

[Function]

move-to-column mark column &optional line

Description:

This function is analogous to move-to-position, except that it moves mark to the position on line which corresponds to the specified column. If the line would not reach to the specified column, then nil is returned and mark is not modified. Note that since a character may be displayed on more than one column on the screen, several different values of column may cause mark to be moved to the same position.

6.10.5. Redisplay

The display of the buffer contents on the screen is updated at the end of each command. The following function can be used to control the scroll position of the buffer in the view.

[Function]

set-scroll-position how &optional what

Description:

Normally, after a command that changes the contents of the buffer or the selection (i.e. the active region), the event handler repositions the view so that the selection is visible, scrolling the buffer as necessary. Calling this function tells the system to not do that, and instead to position the buffer in a particular way. how can be one of the following:

:center-selection--- This causes the selection (or the point) to be centered in the visible area. what is ignored.

:page-up--- This causes the previous page of the buffer to be shown what is ignored.

:page-down--- This causes the next page of the buffer to be shown. what is ignored.

:lines-up--- This causes what previous lines to be scrolled in at the top. what must be an integer.

:lines-down--- This causes what next lines to be scrolled in at the bottom. what must be an integer.

:line--- This causes the line containing what to be scrolled to the top of the view. what must be a mark.


Previous Section Next Section Table of Contents Glossary Index