Documentation ¶
Index ¶
- type EventItemSelected
- type HighlightText
- func (t *HighlightText) ActivateHighlight(index int)
- func (t *HighlightText) AppendLine(line string)
- func (t *HighlightText) ClearText()
- func (t *HighlightText) CurrentHighlight() int
- func (t *HighlightText) Draw()
- func (t *HighlightText) HandleEvent(ev tcell.Event) bool
- func (t *HighlightText) HighlightCount() int
- func (t *HighlightText) HighlightPos(index int) (int, int)
- func (t *HighlightText) Keyword() string
- func (t *HighlightText) Resize()
- func (t *HighlightText) SetKeyword(keyword string)
- func (t *HighlightText) SetView(view views.View)
- func (t *HighlightText) Size() (int, int)
- type InputLine
- func (w *InputLine) Draw()
- func (w *InputLine) HandleEvent(ev tcell.Event) bool
- func (w *InputLine) Resize()
- func (w *InputLine) SetCursorAt(pos int)
- func (w *InputLine) SetPrompt(prompt string)
- func (w *InputLine) SetStyle(style tcell.Style)
- func (w *InputLine) SetValue(value string)
- func (w *InputLine) SetView(view views.View)
- func (w *InputLine) Size() (int, int)
- func (w *InputLine) Value() string
- type ListView
- func (w *ListView) AddItem(text string, style tcell.Style)
- func (w *ListView) DeleteItem(text string)
- func (w *ListView) Draw()
- func (w *ListView) HandleEvent(ev tcell.Event) bool
- func (w *ListView) ItemCount() int
- func (w *ListView) Resize()
- func (w *ListView) SelectAt(index int)
- func (w *ListView) SelectNext()
- func (w *ListView) SelectPrev()
- func (w *ListView) SetStyle(text string, style tcell.Style)
- func (w *ListView) SetView(view views.View)
- func (w *ListView) Size() (int, int)
- type Pager
- func (w *Pager) AppendLine(line string)
- func (w *Pager) ClearText()
- func (w *Pager) Draw()
- func (w *Pager) FindNext() bool
- func (w *Pager) FindPrev() bool
- func (w *Pager) GetScrollYPosition() float64
- func (w *Pager) HandleEvent(ev tcell.Event) bool
- func (w *Pager) Keyword() string
- func (w *Pager) Resize()
- func (w *Pager) ScrollDown()
- func (w *Pager) ScrollHalfPageDown()
- func (w *Pager) ScrollHalfPageLeft()
- func (w *Pager) ScrollHalfPageRight()
- func (w *Pager) ScrollHalfPageUp()
- func (w *Pager) ScrollPageDown()
- func (w *Pager) ScrollPageUp()
- func (w *Pager) ScrollToBottom()
- func (w *Pager) ScrollToTop()
- func (w *Pager) ScrollUp()
- func (w *Pager) SetKeyword(keyword string)
- func (w *Pager) SetView(view views.View)
- func (w *Pager) Size() (int, int)
- type Tabs
- type VerticalLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventItemSelected ¶
type EventItemSelected struct { // The name of the item Name string // The index of the item Index int tcell.EventTime // contains filtered or unexported fields }
EventItemSelected represents an event on the item selected
func (*EventItemSelected) Widget ¶
func (e *EventItemSelected) Widget() views.Widget
Widget returns a target widget of the event
type HighlightText ¶
type HighlightText struct { views.WidgetWatchers // contains filtered or unexported fields }
HighlightText is a text widget with highlighted keyword
func (*HighlightText) ActivateHighlight ¶
func (t *HighlightText) ActivateHighlight(index int)
ActivateHighlight makes the highlighted keyword active (focused)
func (*HighlightText) AppendLine ¶
func (t *HighlightText) AppendLine(line string)
AppendLine appends the line into the content
func (*HighlightText) ClearText ¶
func (t *HighlightText) ClearText()
ClearText clears current content and highlights
func (*HighlightText) CurrentHighlight ¶
func (t *HighlightText) CurrentHighlight() int
CurrentHighlight returns the index of the current highlight. It returns -1 if no highlights are active.
func (*HighlightText) HandleEvent ¶
func (t *HighlightText) HandleEvent(ev tcell.Event) bool
HandleEvent implements a tcell.EventHandler
func (*HighlightText) HighlightCount ¶
func (t *HighlightText) HighlightCount() int
HighlightCount returns the count of the highlighted keywords
func (*HighlightText) HighlightPos ¶
func (t *HighlightText) HighlightPos(index int) (int, int)
HighlightPos returns the position (x, y) of highlighted text in the content
func (*HighlightText) Keyword ¶
func (t *HighlightText) Keyword() string
Keyword returns the current keyword in the content
func (*HighlightText) Resize ¶
func (t *HighlightText) Resize()
Resize is called when the View changes sizes.
func (*HighlightText) SetKeyword ¶
func (t *HighlightText) SetKeyword(keyword string)
SetKeyword sets the keyword to be highlighted in the content
func (*HighlightText) SetView ¶
func (t *HighlightText) SetView(view views.View)
SetView sets the view for the HighlightText
func (*HighlightText) Size ¶
func (t *HighlightText) Size() (int, int)
Size returns the width and height of the HighlightText
type InputLine ¶
type InputLine struct { views.WidgetWatchers // contains filtered or unexported fields }
InputLine is a single-line input widget
func (*InputLine) HandleEvent ¶
HandleEvent handles events on tcell
func (*InputLine) Resize ¶
func (w *InputLine) Resize()
Resize is called when our View changes sizes.
func (*InputLine) SetCursorAt ¶
SetCursorAt sets the pos of the cursor
type ListView ¶
type ListView struct { views.WidgetWatchers // contains filtered or unexported fields }
ListView is a Widget with containing multiple items as a list
func (*ListView) AddItem ¶
AddItem adds a new item with the text and its style. The text must be unique in the list view. It panics when the text is already exists in the list
func (*ListView) DeleteItem ¶
DeleteItem deletes a item with the text. It panics when the text does not exist in the list
func (*ListView) HandleEvent ¶
HandleEvent handles events on tcell
func (*ListView) SelectNext ¶
func (w *ListView) SelectNext()
SelectNext selects next item of the current
func (*ListView) SelectPrev ¶
func (w *ListView) SelectPrev()
SelectPrev selects previous item of the current
func (*ListView) SetStyle ¶
SetStyle updates the style of the text. It panics when the text does not exist in the list.
type Pager ¶
type Pager struct { views.WidgetWatchers // contains filtered or unexported fields }
Pager is a Widget with the text and its view port. It provides a scrollable view if the content size is larger than the actual view.
func (*Pager) AppendLine ¶
AppendLine adds the line into the pager
func (*Pager) ClearText ¶
func (w *Pager) ClearText()
ClearText clears current content on the pager.
func (*Pager) FindNext ¶
FindNext finds next keyword in the content. It returns true if the keyword found.
func (*Pager) FindPrev ¶
FindPrev finds previous keyword in the content. It returns true if the keyword found.
func (*Pager) GetScrollYPosition ¶
GetScrollYPosition returns vertical position of the scroll on the pager. Its range is 0.0 to 1.0.
func (*Pager) HandleEvent ¶
HandleEvent handles events on tcell.
func (*Pager) ScrollDown ¶
func (w *Pager) ScrollDown()
ScrollDown scrolls down by one line on the pager.
func (*Pager) ScrollHalfPageDown ¶
func (w *Pager) ScrollHalfPageDown()
ScrollHalfPageDown scrolls down by half-height of the screen.
func (*Pager) ScrollHalfPageLeft ¶
func (w *Pager) ScrollHalfPageLeft()
ScrollHalfPageLeft scrolls left by half-width of the screen
func (*Pager) ScrollHalfPageRight ¶
func (w *Pager) ScrollHalfPageRight()
ScrollHalfPageRight scrolls right by half-width of the screen.
func (*Pager) ScrollHalfPageUp ¶
func (w *Pager) ScrollHalfPageUp()
ScrollHalfPageUp scrolls up by half-height of the screen.
func (*Pager) ScrollPageDown ¶
func (w *Pager) ScrollPageDown()
ScrollPageDown scrolls down by the height of the screen.
func (*Pager) ScrollPageUp ¶
func (w *Pager) ScrollPageUp()
ScrollPageUp scrolls up by the height of the screen.
func (*Pager) ScrollToBottom ¶
func (w *Pager) ScrollToBottom()
ScrollToBottom scrolls to the bottom of the content.
func (*Pager) ScrollToTop ¶
func (w *Pager) ScrollToTop()
ScrollToTop scrolls to the top of the content
func (*Pager) SetKeyword ¶
SetKeyword sets the keyword to be highlighted in the pager
type Tabs ¶
type Tabs struct { views.BoxLayout views.WidgetWatchers // contains filtered or unexported fields }
Tabs is a View with multiple items in single line.
func (*Tabs) SelectPrev ¶
func (w *Tabs) SelectPrev()
SelectPrev selects previous tab of the current
type VerticalLine ¶
type VerticalLine struct { views.WidgetWatchers // contains filtered or unexported fields }
VerticalLine is a Widget with containing a vertical line.
func NewVerticalLine ¶
func NewVerticalLine(char rune, style tcell.Style) *VerticalLine
NewVerticalLine creates a new VerticalLine
func (*VerticalLine) HandleEvent ¶
func (w *VerticalLine) HandleEvent(ev tcell.Event) bool
HandleEvent handles events on tcell
func (*VerticalLine) Resize ¶
func (w *VerticalLine) Resize()
Resize is called when our View changes sizes.
func (*VerticalLine) SetView ¶
func (w *VerticalLine) SetView(view views.View)
SetView sets the View object used for the vertical line
func (*VerticalLine) Size ¶
func (w *VerticalLine) Size() (int, int)
Size returns the width and height in vertical line, which always (1, 1).