Documentation
¶
Overview ¶
Package choicebar is a small question asked on the context line and answered with a key, the way terminal programs confirm things, e.g. "You have unsaved changes. Enter Save and quit D Discard Esc Cancel". It takes the keyboard like an overlay but draws no box, and knows the UI only through Host.
Index ¶
- type Bar
- func (b *Bar) Choose(i int) tea.Cmd
- func (b *Bar) ContextLine() (string, string)
- func (b *Bar) Find(answer string) int
- func (b *Bar) Indicator() string
- func (b *Bar) Key(k tea.KeyPressMsg) tea.Cmd
- func (b *Bar) Layout() []overlay.Box
- func (b *Bar) Mouse(e overlay.MouseEvent) tea.Cmd
- func (b *Bar) Status() (string, string)
- type Choice
- type Host
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bar ¶
type Bar struct {
Msg string
Warn bool // the message is a warning, e.g. about losing work
Desc string // more on the status line, when the question needs it
Choices []Choice
// contains filtered or unexported fields
}
Bar is the question and its choices.
func (*Bar) ContextLine ¶
ContextLine renders the bar for the context line.
Click to show internal directories.
Click to hide internal directories.