src/swipl-devel/packages/xpce/man/refmanual/md/editor.md

class editor {#class-editor}

Class editor describes a graphical object that can be used to edit long textual descriptions. PCE editors have similar design and user-interface as GNU-Emacs. New functionality may added by means of class key_binding.

WHY A PCE EDITOR?

Many applications manipulate large text fields. For many applications, editing text is one of the most important activities. Unfortunately, there is not much of a standard as far as editors is concerned. For this reason, the best option would be to allow the user to run an editor of his/her choice. Unfortunately no good interfacing protocol is available that allows us to manage the text in the editor from inside PCE and read a considerable amount of status information from the editor.

Therefore, PCE defines it's own editor. The basic user interface of the editor is based on the widely accepted GNU-EMACS editor and can be extended and modified to improve compatibility to other editors.

Organisation {#class-editor-organisation}

Class editor is a subclass of device because it is implemented as a compound graphical object, consisting of the following parts.

| text_image object  | Graphical that displays the text itself  |
| scroll_bar object  | Allows you to scroll the text vertically |
| text_cursor object | Graphical that displays the caret        |
| text_margin object | Optional annotation margin               |
| text_buffer object | Storage and low-level manipulation       |

Vocabulary {#class-editor-vocabulary}

The editor uses the following vocabulary:

Compatibility {#class-editor-compatibility}

The UI of PCE editors is based on GNU-EMACS. Many of the basic function of GNU-EMACS are available. Like GNU-EMACS, the PCE editors can be programmed. Unlike GNU-EMACS however, this is not done by programming EMACS-LISP, but by adding methods to the editor (or class editor) and linking these methods to key-strokes.

As the basic functionality is rich and can be expanded/redefined, it should not be very difficult to transform the PCE-editor into an editor that is largely compatible to most available editors.

Mouse and keyboard {#class-editor-mouse-and-keyboard}

PCE-editors can be operated both mouse-driven and keyboard-driven, although the latter is the principal way of manipulating a text.

@see class key_binding @see class view @see class text @see class text_buffer @see class style @see class fragment @see class font @see tool Card Viewer

Class variables {#class-editor-classvars}

Instance variables {#class-editor-instvars}

Send methods {#class-editor-send}

Get methods {#class-editor-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.