-
Notifications
You must be signed in to change notification settings - Fork 747
Description
When building applications that prompt rich forms, we may need the capability that we could scroll some long contents, optionally with viewport following the cursor. An example that implements this concept is nmtui
.
If a widget is simple, one approach is to (ab)use FormattedTextControl
inside a window, typesetting (?) the content of each block and arrange cursor positions. This idea works well with smaller components, and is already seen in widgets like CheckboxList
, #711 for editable buffers, and the option list of pyvim (this is especially brilliant, in my oponion).
When building some complex blocks to compose them, the logic to maintain contents/positions for a long block would be a nightmare. For an instance of what I mean complex, see cslack, in urwid.
It is straightforward to mock a view using HSplit
and VSplit
, however they seem to divide the screen and cannot be placed inside a window. I have seen a similar feature request in #949 and surveyed some showcases, but still have no idea on how to achieve this. Maybe I should start by inheriting UIContent. Is there some development docs that I can refer to create such a component?