Documentation
¶
Overview ¶
Package progress provides a simple progress bar.
Index ¶
- func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- type IWidget
- type Options
- type ProgressCB
- type TargetCB
- type Widget
- func (w *Widget) Complete() gowid.ICellStyler
- func (w *Widget) Normal() gowid.ICellStyler
- func (w *Widget) OnSetProgress(f gowid.IWidgetChangedCallback)
- func (w *Widget) OnSetTarget(f gowid.IWidgetChangedCallback)
- func (w *Widget) Progress() int
- func (w *Widget) RemoveOnSetProgress(f gowid.IIdentity)
- func (w *Widget) RemoveOnSetTarget(f gowid.IIdentity)
- func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
- func (w *Widget) SetProgress(app gowid.IApp, current int)
- func (w *Widget) SetTarget(app gowid.IApp, target int)
- func (w *Widget) String() string
- func (w *Widget) Target() int
- func (w *Widget) Text() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IWidget ¶
type IWidget interface { gowid.IWidget // Text should return the string to be displayed inside the progress bar e.g. "50%" Text() string // Progress returns the number of units completed. Progress() int // Target returns the number of units required overall. Target() int // Normal is used to render the incomplete part of the progress bar. Normal() gowid.ICellStyler // Complete is used to render the complete part of the progress bar. Complete() gowid.ICellStyler }
IWidget - if your widget implements progress.IWidget, you will be able to render it using the progress.Render() function.
type Options ¶
type Options struct {
Normal, Complete gowid.ICellStyler
Target, Current int
}
Options is used for passing arguments to the progressbar initializer, New().
type Widget ¶
type Widget struct {
Current, Done int
Callbacks *gowid.Callbacks
gowid.RejectUserInput
gowid.NotSelectable
// contains filtered or unexported fields
}
Widget is the concrete type of a progressbar widget.
func (*Widget) Complete ¶
func (w *Widget) Complete() gowid.ICellStyler
func (*Widget) Normal ¶
func (w *Widget) Normal() gowid.ICellStyler
func (*Widget) OnSetProgress ¶
func (w *Widget) OnSetProgress(f gowid.IWidgetChangedCallback)
func (*Widget) OnSetTarget ¶
func (w *Widget) OnSetTarget(f gowid.IWidgetChangedCallback)
func (*Widget) RemoveOnSetProgress ¶
func (*Widget) RemoveOnSetTarget ¶
func (*Widget) RenderSize ¶
func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
Click to show internal directories.
Click to hide internal directories.