Documentation ¶
Index ¶
- Constants
- type ActivityModeGauge
- func (g *ActivityModeGauge) Draw(screen tcell.Screen)
- func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive))
- func (g *ActivityModeGauge) GetRect() (int, int, int, int)
- func (g *ActivityModeGauge) HasFocus() bool
- func (g *ActivityModeGauge) Pulse()
- func (g *ActivityModeGauge) Reset()
- func (g *ActivityModeGauge) SetPgBgColor(color tcell.Color)
- func (g *ActivityModeGauge) SetRect(x, y, width, height int)
- func (g *ActivityModeGauge) SetTitle(title string)
- type BarChart
- func (c *BarChart) AddBar(label string, value int, color tcell.Color)
- func (c *BarChart) Draw(screen tcell.Screen)
- func (c *BarChart) Focus(delegate func(p tview.Primitive))
- func (c *BarChart) GetRect() (int, int, int, int)
- func (c *BarChart) HasFocus() bool
- func (c *BarChart) SetBarValue(name string, value int)
- func (c *BarChart) SetBorder(status bool)
- func (c *BarChart) SetMaxValue(max int)
- func (c *BarChart) SetRect(x, y, width, height int)
- type BarChartItem
- type Marker
- type MessageDialog
- func (d *MessageDialog) Draw(screen tcell.Screen)
- func (d *MessageDialog) Focus(delegate func(p tview.Primitive))
- func (d *MessageDialog) HasFocus() bool
- func (d *MessageDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (d *MessageDialog) MouseHandler() ...
- func (d *MessageDialog) SetBackgroundColor(color tcell.Color)
- func (d *MessageDialog) SetBorder(status bool)
- func (d *MessageDialog) SetDoneFunc(handler func()) *MessageDialog
- func (d *MessageDialog) SetMessage(message string)
- func (d *MessageDialog) SetRect(x, y, width, height int)
- func (d *MessageDialog) SetTextColor(color tcell.Color)
- func (d *MessageDialog) SetTitle(title string)
- func (d *MessageDialog) SetType(dtype int)
- type PercentageModeGauge
- func (g *PercentageModeGauge) Draw(screen tcell.Screen)
- func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive))
- func (g *PercentageModeGauge) GetMaxValue() int
- func (g *PercentageModeGauge) GetRect() (int, int, int, int)
- func (g *PercentageModeGauge) GetValue() int
- func (g *PercentageModeGauge) HasFocus() bool
- func (g *PercentageModeGauge) Reset()
- func (g *PercentageModeGauge) SetMaxValue(value int)
- func (g *PercentageModeGauge) SetPgBgColor(color tcell.Color)
- func (g *PercentageModeGauge) SetRect(x, y, width, height int)
- func (g *PercentageModeGauge) SetTitle(title string)
- func (g *PercentageModeGauge) SetValue(value int)
- type Plot
- func (plot *Plot) Draw(screen tcell.Screen)
- func (plot *Plot) SetAxesColor(color tcell.Color)
- func (plot *Plot) SetAxesLabelColor(color tcell.Color)
- func (plot *Plot) SetData(data [][]float64)
- func (plot *Plot) SetDotMarkerRune(r rune)
- func (plot *Plot) SetDrawAxes(draw bool)
- func (plot *Plot) SetLineColor(color []tcell.Color)
- func (plot *Plot) SetMarker(marker Marker)
- func (plot *Plot) SetPlotType(ptype PlotType)
- func (plot *Plot) SetRect(x, y, width, height int)
- type PlotType
- type Spinner
- type SpinnerStyle
- type UtilModeGauge
- func (g *UtilModeGauge) Draw(screen tcell.Screen)
- func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive))
- func (g *UtilModeGauge) GetRect() (int, int, int, int)
- func (g *UtilModeGauge) GetValue() float64
- func (g *UtilModeGauge) HasFocus() bool
- func (g *UtilModeGauge) SetCritPercentage(percentage float64)
- func (g *UtilModeGauge) SetLabel(label string)
- func (g *UtilModeGauge) SetLabelColor(color tcell.Color)
- func (g *UtilModeGauge) SetRect(x, y, width, height int)
- func (g *UtilModeGauge) SetTitle(title string)
- func (g *UtilModeGauge) SetValue(value float64)
- func (g *UtilModeGauge) SetWarnPercentage(percentage float64)
Constants ¶
const ( InfoDialog = 0 + iota ErrorDailog )
represents dialog type.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityModeGauge ¶
ActivityModeGauge represents activity mode gauge permitive.
func NewActivityModeGauge ¶
func NewActivityModeGauge() *ActivityModeGauge
NewActivityModeGauge returns new activity mode gauge permitive.
func (*ActivityModeGauge) Draw ¶
func (g *ActivityModeGauge) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*ActivityModeGauge) Focus ¶
func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*ActivityModeGauge) GetRect ¶
func (g *ActivityModeGauge) GetRect() (int, int, int, int)
GetRect return primitive current rect.
func (*ActivityModeGauge) HasFocus ¶
func (g *ActivityModeGauge) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*ActivityModeGauge) Pulse ¶
func (g *ActivityModeGauge) Pulse()
Pulse pulse update the gauge progress bar.
func (*ActivityModeGauge) Reset ¶
func (g *ActivityModeGauge) Reset()
Reset resets the gauge counter (set to 0).
func (*ActivityModeGauge) SetPgBgColor ¶
func (g *ActivityModeGauge) SetPgBgColor(color tcell.Color)
SetPgBgColor sets progress block background color.
func (*ActivityModeGauge) SetRect ¶
func (g *ActivityModeGauge) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*ActivityModeGauge) SetTitle ¶
func (g *ActivityModeGauge) SetTitle(title string)
SetTitle sets title for this primitive.
type BarChart ¶
BarChart represents bar chart primitive.
func (*BarChart) Draw ¶
func (c *BarChart) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*BarChart) SetBarValue ¶
SetBarValue sets bar values.
func (*BarChart) SetMaxValue ¶
SetMaxValue sets maximum value of bars.
type BarChartItem ¶
type BarChartItem struct {
// contains filtered or unexported fields
}
BarChartItem represents a single bar in bar chart.
type MessageDialog ¶
MessageDialog represents message dialog primitive.
func NewMessageDialog ¶
func NewMessageDialog(dtype int) *MessageDialog
NewMessageDialog returns a new message dialog primitive.
func (*MessageDialog) Draw ¶
func (d *MessageDialog) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*MessageDialog) Focus ¶
func (d *MessageDialog) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*MessageDialog) HasFocus ¶
func (d *MessageDialog) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*MessageDialog) InputHandler ¶
func (d *MessageDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns input handler function for this primitive.
func (*MessageDialog) MouseHandler ¶
func (d *MessageDialog) 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 (*MessageDialog) SetBackgroundColor ¶
func (d *MessageDialog) SetBackgroundColor(color tcell.Color)
SetBackgroundColor sets dialog background color.
func (*MessageDialog) SetBorder ¶
func (d *MessageDialog) SetBorder(status bool)
SetBorder sets dialogs border - no effect always true.
func (*MessageDialog) SetDoneFunc ¶
func (d *MessageDialog) SetDoneFunc(handler func()) *MessageDialog
SetDoneFunc sets callback function for when user clicked on the the button or presses "enter" or "esc".
func (*MessageDialog) SetMessage ¶
func (d *MessageDialog) SetMessage(message string)
SetMessage sets the dialog message to display.
func (*MessageDialog) SetRect ¶
func (d *MessageDialog) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*MessageDialog) SetTextColor ¶
func (d *MessageDialog) SetTextColor(color tcell.Color)
SetTextColor sets dialog's message text color.
func (*MessageDialog) SetTitle ¶
func (d *MessageDialog) SetTitle(title string)
SetTitle sets title for this primitive.
func (*MessageDialog) SetType ¶
func (d *MessageDialog) SetType(dtype int)
SetType sets dialog type to info or error.
type PercentageModeGauge ¶
PercentageModeGauge represents percentage mode gauge permitive.
func NewPercentageModeGauge ¶
func NewPercentageModeGauge() *PercentageModeGauge
NewPercentageModeGauge returns new percentage mode gauge permitive.
func (*PercentageModeGauge) Draw ¶
func (g *PercentageModeGauge) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*PercentageModeGauge) Focus ¶
func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*PercentageModeGauge) GetMaxValue ¶
func (g *PercentageModeGauge) GetMaxValue() int
GetMaxValue returns maximum allows value for the gauge.
func (*PercentageModeGauge) GetRect ¶
func (g *PercentageModeGauge) GetRect() (int, int, int, int)
GetRect return primitive current rect.
func (*PercentageModeGauge) GetValue ¶
func (g *PercentageModeGauge) GetValue() int
GetValue returns current gauge value.
func (*PercentageModeGauge) HasFocus ¶
func (g *PercentageModeGauge) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*PercentageModeGauge) Reset ¶
func (g *PercentageModeGauge) Reset()
Reset resets the gauge counter (set to 0).
func (*PercentageModeGauge) SetMaxValue ¶
func (g *PercentageModeGauge) SetMaxValue(value int)
SetMaxValue set maximum allows value for the gauge.
func (*PercentageModeGauge) SetPgBgColor ¶
func (g *PercentageModeGauge) SetPgBgColor(color tcell.Color)
SetPgBgColor sets progress block background color.
func (*PercentageModeGauge) SetRect ¶
func (g *PercentageModeGauge) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*PercentageModeGauge) SetTitle ¶
func (g *PercentageModeGauge) SetTitle(title string)
SetTitle sets title for this primitive.
func (*PercentageModeGauge) SetValue ¶
func (g *PercentageModeGauge) SetValue(value int)
SetValue update the gauge progress.
type Plot ¶
Plot represents a plot primitive used for different charts.
func (*Plot) Draw ¶
func (plot *Plot) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*Plot) SetAxesColor ¶
func (plot *Plot) SetAxesColor(color tcell.Color)
SetAxesColor sets axes x and y lines color.
func (*Plot) SetAxesLabelColor ¶
func (plot *Plot) SetAxesLabelColor(color tcell.Color)
SetAxesLabelColor sets axes x and y label color.
func (*Plot) SetDotMarkerRune ¶
SetDotMarkerRune sets dot marker rune.
func (*Plot) SetDrawAxes ¶
SetDrawAxes set true in order to draw axes to screen.
func (*Plot) SetLineColor ¶
func (plot *Plot) SetLineColor(color []tcell.Color)
SetLineColor sets chart line color.
func (*Plot) SetPlotType ¶
SetPlotType sets plot type (linechart or scatter).
type Spinner ¶
Spinner represents a spinner widget.
func (*Spinner) Draw ¶
func (s *Spinner) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*Spinner) SetCustomStyle ¶
SetCustomStyle sets a list of runes as custom frames to show as the spinner.
func (*Spinner) SetStyle ¶
func (s *Spinner) SetStyle(style SpinnerStyle) *Spinner
SetStyle sets the spinner style.
type SpinnerStyle ¶
type SpinnerStyle int
const ( SpinnerDotsCircling SpinnerStyle = iota SpinnerDotsUpDown SpinnerBounce SpinnerLine SpinnerCircleQuarters SpinnerSquareCorners SpinnerCircleHalves SpinnerCorners SpinnerArrows SpinnerHamburger SpinnerStack SpinnerGrowHorizontal SpinnerGrowVertical SpinnerStar SpinnerBoxBounce )
type UtilModeGauge ¶
UtilModeGauge represents utilisation mode gauge permitive.
func NewUtilModeGauge ¶
func NewUtilModeGauge() *UtilModeGauge
NewUtilModeGauge returns new utilisation mode gauge permitive.
func (*UtilModeGauge) Draw ¶
func (g *UtilModeGauge) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*UtilModeGauge) Focus ¶
func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*UtilModeGauge) GetRect ¶
func (g *UtilModeGauge) GetRect() (int, int, int, int)
GetRect return primitive current rect.
func (*UtilModeGauge) GetValue ¶
func (g *UtilModeGauge) GetValue() float64
GetValue returns current gauge value.
func (*UtilModeGauge) HasFocus ¶
func (g *UtilModeGauge) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*UtilModeGauge) SetCritPercentage ¶
func (g *UtilModeGauge) SetCritPercentage(percentage float64)
SetCritPercentage sets critical percentage start range.
func (*UtilModeGauge) SetLabel ¶
func (g *UtilModeGauge) SetLabel(label string)
SetLabel sets label for this primitive.
func (*UtilModeGauge) SetLabelColor ¶
func (g *UtilModeGauge) SetLabelColor(color tcell.Color)
SetLabelColor sets label text color.
func (*UtilModeGauge) SetRect ¶
func (g *UtilModeGauge) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*UtilModeGauge) SetTitle ¶
func (g *UtilModeGauge) SetTitle(title string)
SetTitle sets title for this primitive.
func (*UtilModeGauge) SetValue ¶
func (g *UtilModeGauge) SetValue(value float64)
SetValue update the gauge progress.
func (*UtilModeGauge) SetWarnPercentage ¶
func (g *UtilModeGauge) SetWarnPercentage(percentage float64)
SetWarnPercentage sets warning percentage start range.