Documentation
¶
Index ¶
- type EventPollable
- type InitializedScreen
- type ScreenHandler
- func (s *ScreenHandler) Clear()
- func (s *ScreenHandler) Dimensions() (x, y, w, h int)
- func (s *ScreenHandler) DrawBox(x, y, w, h int, style styling.DrawStyling)
- func (s *ScreenHandler) DrawText(x, y, w, h int, style styling.DrawStyling, text string)
- func (s *ScreenHandler) Fini()
- func (s *ScreenHandler) GetEventPollable() EventPollable
- func (s *ScreenHandler) HideCursor()
- func (s *ScreenHandler) NeedsSync()
- func (s *ScreenHandler) Show()
- func (s *ScreenHandler) ShowCursor(loc ui.CursorLocation)
- type ScreenSynchronizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventPollable ¶
type EventPollable interface {
PollEvent() tcell.Event
}
EventPollable only allows access to PollEvent of a tcell.Screen.
type InitializedScreen ¶
type InitializedScreen interface {
Fini()
}
InitializedScreen allows access only to the finalizing functionality of an initialized screen.
type ScreenHandler ¶
type ScreenHandler struct {
// contains filtered or unexported fields
}
ScreenHandler allows rendering to a terminal (via tcell.Screen). It also handles synchronization (e.g. on resize) when prompted accordingly.
func NewTUIScreenHandler ¶
func NewTUIScreenHandler() *ScreenHandler
NewTUIScreenHandler initializes and returns a TUIScreenHandler.
func (*ScreenHandler) Clear ¶
func (s *ScreenHandler) Clear()
Clear clears the underlying screen. If this is not done before drawing new things, old contents that are not overwritten will remain visible on the next Show.
func (*ScreenHandler) Dimensions ¶ added in v0.8.0
func (s *ScreenHandler) Dimensions() (x, y, w, h int)
Dimensions returns the current dimensions of the underlying screen.
func (*ScreenHandler) DrawBox ¶
func (s *ScreenHandler) DrawBox(x, y, w, h int, style styling.DrawStyling)
DrawBox draws a box of the given dimensions in the given style's background color. Note that this overwrites contents within the dimensions.
func (*ScreenHandler) DrawText ¶
func (s *ScreenHandler) DrawText(x, y, w, h int, style styling.DrawStyling, text string)
DrawText draws given text, within given dimensions in the given style.
func (*ScreenHandler) Fini ¶
func (s *ScreenHandler) Fini()
Fini finalizes the screen, e.g., for clean program shutdown.
func (*ScreenHandler) GetEventPollable ¶
func (s *ScreenHandler) GetEventPollable() EventPollable
GetEventPollable returns the underlying screen as an EventPollable.
func (*ScreenHandler) HideCursor ¶
func (s *ScreenHandler) HideCursor()
HideCursor hides the text cursor.
func (*ScreenHandler) NeedsSync ¶
func (s *ScreenHandler) NeedsSync()
NeedsSync registers that a synchronization of the underlying screen is necessary. This is necessary on resize events.
func (*ScreenHandler) Show ¶
func (s *ScreenHandler) Show()
Show shows the drawn contents, taking the necessity for synchronization into account.
func (*ScreenHandler) ShowCursor ¶
func (s *ScreenHandler) ShowCursor(loc ui.CursorLocation)
ShowCursor sets the position of the text cursor.
type ScreenSynchronizer ¶
type ScreenSynchronizer interface {
NeedsSync()
}
ScreenSynchronizer allows access only to a screen handler's synchronization notification functionality.