Skip to content

Add refresh script for Live data #154

Open
@thijssnelleman

Description

@thijssnelleman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions