ProgressBar

An element which is used to display progress as a fillable bar

Create from source

func NewProgressBar(session Session, params Params) ProgressBar

Create new progress bar object and returns its interface

Create from resource

ProgressBar {
    id = progressBar,
    progress-max = 1,
    progress-value = 0.5,
}

Interface description

Inherit methods, properties and events from View

Properties

"max"

Same as "progress-max"

Constant: Max

"progress-max"

Maximum value, default is 1

Constant: ProgressBarMax

Types: float, int, string

Internal type is float, other types converted to it during assignment

Examples

ProgressBar {
    progress-max = 100,
    progress-value = 30,
}
progress := rui.NewProgressBar(session, rui.Params{
    rui.ProgressBarMax:   100,
    rui.ProgressBarValue: 30,
})

"progress-value"

Current value, default is 0

Constant: ProgressBarValue

Types: float, int, string

Internal type is float, other types converted to it during assignment

Examples

ProgressBar {
    progress-max = 100,
    progress-value = 33.3,
}
progress := rui.NewProgressBar(session, rui.Params{
    rui.ProgressBarMax:   100,
    rui.ProgressBarValue: 33.3,
})

"value"

Same as "progress-value"

Constant: Value

func GetProgressBarMax(view View, subviewID ...string) float64

Returns the max value of ProgressBar subview. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned

func GetProgressBarValue(view View, subviewID ...string) float64

Returns the value of ProgressBar subview. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned

func ProgressBarByID(rootView View, id string) ProgressBar

Return a ProgressBar with id equal to the argument of the function or nil if there is no such View or View is not a ProgressBar