primitive

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Modal struct {
	*tview.Box
	// contains filtered or unexported fields
}

Modal is a centered message window used to inform the user.

This primitive is based on https://github.com/rivo/tview/wiki/Modal. To see what we extended, search through for EXTENDED comments.

func NewModal

func NewModal() *Modal

NewModal returns a new modal message window.

func (*Modal) Draw

func (m *Modal) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*Modal) Focus

func (m *Modal) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*Modal) HasFocus

func (m *Modal) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*Modal) SetBackgroundColor

func (m *Modal) SetBackgroundColor(color tcell.Color) *Modal

SetBackgroundColor sets the color of the modal frame background.

func (*Modal) SetBorder

func (m *Modal) SetBorder(show bool) *Modal

SetBorder sets the flag indicating whether or not the frame should have a border.

func (*Modal) SetBorderColor

func (m *Modal) SetBorderColor(color tcell.Color) *Modal

SetBorderColor sets the frame's border color. EXTENDED.

func (*Modal) SetText

func (m *Modal) SetText(text string) *Modal

SetText sets the message text of the window. The text may contain line breaks. Note that words are wrapped, too, based on the final size of the window.

func (*Modal) SetTextColor

func (m *Modal) SetTextColor(color tcell.Color) *Modal

SetTextColor sets the color of the message text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL