ProgressBar

ProgressBar example

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, ids ...string) ProgressBar

Returns the child ProgressBar, path to which is specified using the arguments id, ids. Example: view := ProgressBarByID(rootView, "id1", "id2", "id3"), view := ProgressBarByID(rootView, "id1/id2/id3"). These two function calls are equivalent. If a View with this path is not found or View is not ProgressBar, the function will return nil.