Documentation
¶
Index ¶
- func NewTui() *tui
- type Modal
- func (m *Modal) AddButtons(labels []string) *Modal
- func (m *Modal) AddInputFields(labels []string) *Modal
- func (m *Modal) ClearButtons() *Modal
- func (m *Modal) Draw(screen tcell.Screen)
- func (m *Modal) Focus(delegate func(p tview.Primitive))
- func (m *Modal) HasFocus() bool
- func (m *Modal) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (m *Modal) MouseHandler() ...
- func (m *Modal) SetBackgroundColor(color tcell.Color) *Modal
- func (m *Modal) SetButtonActivatedStyle(style tcell.Style) *Modal
- func (m *Modal) SetButtonBackgroundColor(color tcell.Color) *Modal
- func (m *Modal) SetButtonStyle(style tcell.Style) *Modal
- func (m *Modal) SetButtonTextColor(color tcell.Color) *Modal
- func (m *Modal) SetChangedFunc(handler func(inputIndex int, inputValue string)) *Modal
- func (m *Modal) SetDoneFunc(handler func(buttonIndex int, buttonLabel string)) *Modal
- func (m *Modal) SetFocus(index int) *Modal
- func (m *Modal) SetText(text string) *Modal
- func (m *Modal) SetTextColor(color tcell.Color) *Modal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Modal ¶
func (*Modal) AddButtons ¶
AddButtons adds buttons to the window. There must be at least one button and a "done" handler so the window can be closed again.
func (*Modal) AddInputFields ¶
func (*Modal) ClearButtons ¶
ClearButtons removes all buttons from the window.
func (*Modal) Draw ¶
func (m *Modal) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*Modal) InputHandler ¶
InputHandler returns the handler for this primitive.
func (*Modal) MouseHandler ¶
func (m *Modal) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler for this primitive.
func (*Modal) SetBackgroundColor ¶
SetBackgroundColor sets the color of the modal frame background.
func (*Modal) SetButtonActivatedStyle ¶
SetButtonActivatedStyle sets the style of the buttons when they are focused.
func (*Modal) SetButtonBackgroundColor ¶
SetButtonBackgroundColor sets the background color of the buttons.
func (*Modal) SetButtonStyle ¶
SetButtonStyle sets the style of the buttons when they are not focused.
func (*Modal) SetButtonTextColor ¶
SetButtonTextColor sets the color of the button texts.
func (*Modal) SetChangedFunc ¶
func (*Modal) SetDoneFunc ¶
SetDoneFunc sets a handler which is called when one of the buttons was pressed. It receives the index of the button as well as its label text. The handler is also called when the user presses the Escape key. The index will then be negative and the label text an empty string.
func (*Modal) SetText ¶
SetText sets the message text of the window. The text may contain line breaks but style tag states will not transfer to following lines. Note that words are wrapped, too, based on the final size of the window.
func (*Modal) SetTextColor ¶
SetTextColor sets the color of the message text.