Documentation ¶
Overview ¶
Package scrollabletext provides a text widget that can be placed inside withscrollbar.Widget
Index ¶
- type Widget
- func (w *Widget) Down(lines int, size gowid.IRenderSize, app gowid.IApp)
- func (w *Widget) DownPage(num int, size gowid.IRenderSize, app gowid.IApp)
- func (w *Widget) ScrollLength() int
- func (w *Widget) ScrollPosition() int
- func (w *Widget) Up(lines int, size gowid.IRenderSize, app gowid.IApp)
- func (w *Widget) UpPage(num int, size gowid.IRenderSize, app gowid.IApp)
- func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Widget ¶
type Widget struct { *selectable.Widget // contains filtered or unexported fields }
Widget constructs a text widget and allows it to be scrolled. But this widget is limited - it assumes no line will wrap. To make this happen it ensures that any lines that are too long are clipped. It makes this assumption because my scrollbar APIs are not well designed, and functions like ScrollPosition and ScrollLength don't understand the current rendering context. That means if the app is resized, and a line now takes two screen lines to render and not one, the scrollbar can't be built accurately. Until I design a better scrollbar API, this will work - I'm only using it for limited information dialogs at the moment.
func (*Widget) ScrollLength ¶
func (*Widget) ScrollPosition ¶
Implement functions for withscrollbar.Widget