Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refresh script for Live data #154

Open
thijssnelleman opened this issue Dec 11, 2024 · 0 comments
Open

Add refresh script for Live data #154

thijssnelleman opened this issue Dec 11, 2024 · 0 comments
Labels
Enhancement New feature or request

Comments

@thijssnelleman
Copy link

Is your feature request related to a problem? Please describe.
I am using the library to represent my data as a table and it is periodically being refresh (live data). Currently I do not see a way to run a script in the background to refresh data. There are trigger based refreshes, but no interval refresh methods.

Describe the solution you'd like
Some kind of input script that allows me to refresh the data in the Window class.

Describe alternatives you've considered
I tried to see if I could set up some trigger automatically every few seconds, didn't work.

Is this feature present in other TUI products?
I do not think so, but if so please let me know

Additional context
My refresh script:

def refresh_data(self: ptg.Window) -> None: """Refresh the table.""" data_table = jobs_help.create_jobs_table(jobs, markup=True).splitlines() for iw, widget in enumerate(self._widgets): self._widgets[iw] = type(widget)(data_table[iw], onclick=cancel_jobs) self._widgets[iw].parent = self

So this is run after a ptg.Button trigger

@thijssnelleman thijssnelleman added the Enhancement New feature or request label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant