Problem updating progress bar incrementally #3135
-
Hi, I really love Textual and I'm having a great time using it. I want to add a progress bar to display some feedback about a long-running task in my GUI. The task is a method called from an external class. I'm working directly with the isolated progress bar example in the docs. There are two files in my example: the GUI, and the external class I thought that a good way to do this is with a callback function that notifies the GUI to advance the progress bar each time the external class makes progress on its task. Here, I am just trying to pass the When I run this and press 'S' to start, the progress bar freezes, and then jumps to 100%. Of course, ideally, it would smoothly advance from 0 -> N and then stop. I assume this problem has something to do with asynchronicity. I would be very appreciative if someone could point to what I need to change to achieve this correctly! I wouldn't be surprised if it's something pretty simple. Thanks in advance.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Have a look over https://textual.textualize.io/guide/workers/ |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the quick help! I did look at the Workers reference, but I'm sorry to say I can't understand how to apply the Weather widget example to this. All I want is for the Should the |
Beta Was this translation helpful? Give feedback.
Something like this: