Documentation
¶
Index ¶
- type ActionModal
- func (m *ActionModal) AddButtons(labels []string) *ActionModal
- func (m *ActionModal) ClearButtons() *ActionModal
- func (m *ActionModal) Draw(screen tcell.Screen)
- func (m *ActionModal) Focus(delegate func(p tview.Primitive))
- func (m *ActionModal) GetFooter() *tview.TextView
- func (m *ActionModal) HasFocus() bool
- func (m *ActionModal) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (m *ActionModal) MouseHandler() ...
- func (m *ActionModal) SetBackgroundColor(color tcell.Color) *ActionModal
- func (m *ActionModal) SetButtonBackgroundColor(color tcell.Color) *ActionModal
- func (m *ActionModal) SetButtonTextColor(color tcell.Color) *ActionModal
- func (m *ActionModal) SetDoneFunc(handler func(buttonIndex int, buttonLabel string)) *ActionModal
- func (m *ActionModal) SetFocus(index int) *ActionModal
- func (m *ActionModal) SetText(text string) *ActionModal
- func (m *ActionModal) SetTextColor(color tcell.Color) *ActionModal
- type InfoModal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionModal ¶
ActionModal is a centered message window used to inform the user or prompt them for an immediate decision. It needs to have at least one button (added via AddButtons()) or it will never disappear.
This primitive is based on tview.Modal.
func NewActionModal ¶
func NewActionModal() *ActionModal
NewActionModal returns a new modal message window.
func (*ActionModal) AddButtons ¶
func (m *ActionModal) AddButtons(labels []string) *ActionModal
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 (*ActionModal) ClearButtons ¶
func (m *ActionModal) ClearButtons() *ActionModal
ClearButtons removes all buttons from the window.
func (*ActionModal) Draw ¶
func (m *ActionModal) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*ActionModal) Focus ¶
func (m *ActionModal) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*ActionModal) GetFooter ¶
func (m *ActionModal) GetFooter() *tview.TextView
GetFooter returns the footer of the modal.
func (*ActionModal) HasFocus ¶
func (m *ActionModal) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*ActionModal) InputHandler ¶
func (m *ActionModal) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns the handler for this primitive.
func (*ActionModal) MouseHandler ¶
func (m *ActionModal) 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 (*ActionModal) SetBackgroundColor ¶
func (m *ActionModal) SetBackgroundColor(color tcell.Color) *ActionModal
SetBackgroundColor sets the color of the modal frame background.
func (*ActionModal) SetButtonBackgroundColor ¶
func (m *ActionModal) SetButtonBackgroundColor(color tcell.Color) *ActionModal
SetButtonBackgroundColor sets the background color of the buttons.
func (*ActionModal) SetButtonTextColor ¶
func (m *ActionModal) SetButtonTextColor(color tcell.Color) *ActionModal
SetButtonTextColor sets the color of the button texts.
func (*ActionModal) SetDoneFunc ¶
func (m *ActionModal) SetDoneFunc(handler func(buttonIndex int, buttonLabel string)) *ActionModal
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 emptry string.
func (*ActionModal) SetFocus ¶
func (m *ActionModal) SetFocus(index int) *ActionModal
SetFocus shifts the focus to the button with the given index.
func (*ActionModal) SetText ¶
func (m *ActionModal) SetText(text string) *ActionModal
SetText sets the message text of the window. The text may contain line breaks but color tag states will not transfer to following lines. Note that words are wrapped, too, based on the final size of the window.
func (*ActionModal) SetTextColor ¶
func (m *ActionModal) SetTextColor(color tcell.Color) *ActionModal
SetTextColor sets the color of the message text.
type InfoModal ¶
InfoModal is a centered message window used to inform the user or prompt them for an immediate decision. It needs to have at least one button (added via AddButtons()) or it will never disappear.
This primitive is based on tview.Modal.
func (*InfoModal) Draw ¶
func (i *InfoModal) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.