Record presenting a frontend's interface.
- to see some code, look at the function
refreshEditorin Yi.Core. This is the only place where
- the function
layoutis responsible for updating the
Editorwith the width and height of the windows. Some frontends, such as Pango, need to modify their internal state to do this, and will consequently change their display. This is expected.
- the function
refreshshould cause the UI to update its display with the information given in the
- the functionalities of
refreshoverlap to some extent, in the sense that both may cause the frontend to update its display. The Yi core provides the following guarantees which the frontend may take advantage of:
- in the main editor loop (i.e. in the
layoutwill be run (possibly multiple times) and then
refreshwill be run. This guarantee will hold even in the case of threading (the function
refreshEditorwill always be run atomically, using
- between the last run of
layoutand the run of
refresh, some changes may be made to the
Editor. However, the text, text attributes, and (displayed) window region of all windows will remain the same. However, the cursor location may change.
The Yi core provides no guarantee about the OS thread from which the functions
refresh are called from. In particular, subprocesses (e.g. compilation,
ghci) will run
refresh from new OS threads (see
in Yi.Core). The frontend must be preparaed for this: for instance, Gtk-based frontends
should wrap GUI updates in