Replies: 1 comment 2 replies
-
You can simply create a new element in the same style as done internally by NiceGUI. For example the QLinearProgress from JustPy is wrapped like this: class linear_progress(nicegui.elements.float_element.FloatElement):
def __init__(self, *, value: float = 0):
view = jp.QLinearProgress(value=value, temp=False)
super().__init__(view, value=value, on_change=None) If you want to update the value, there is no need to access the underlying JustPy view for data bindings. Simply use the progress = linear_progress()
ui.timer(0.01, lambda: progress.set_value(progress.value + 0.001)) Or use NiceGUI bindings if you have a data model (like a Downloader class which provides a float between 0 and 1 as linear_progress().bind_value_from(downloader, 'progress') |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@hroemer asked this question in #94.
Beta Was this translation helpful? Give feedback.
All reactions