ProgressBar

Example:

from flexx import app, event, ui

class Example(ui.Widget):

    def init(self):
        with ui.HBox():
            self.b1 = ui.Button(flex=0, text='Less')
            self.b2 = ui.Button(flex=0, text='More')
            self.prog = ui.ProgressBar(flex=1, value=0.1, text='{percent} done')

    @event.reaction('b1.pointer_down', 'b2.pointer_down')
    def _change_progress(self, *events):
        for ev in events:
            if ev.source is self.b1:
                self.prog.set_value(self.prog.value - 0.1)
            else:
                self.prog.set_value(self.prog.value + 0.1)
open in new tab


class flexx.ui.ProgressBar(*init_args, **kwargs)

Inherits from: Widget

A widget to show progress.

The node of this widget is a <div> containing a few HTML elements for rendering.

properties: max, min, text, value

actions: set_max, set_min, set_text, set_value

max

FloatProp – The maximum progress value.

min

FloatProp – The minimum progress value.

set_max(*val)

action – Setter for the ‘max’ property.

set_min(*val)

action – Setter for the ‘min’ property.

set_text(*val)

action – Setter for the ‘text’ property.

set_value(value)

action – set_value

text

StringProp – The label to display on the progress bar. Occurances of “{percent}” are replaced with the current percentage, and “{value}” with the current value.

value

FloatProp – The progress value.