Closed neutrino2211 closed 1 month ago
Thanks so much for opening the issue! I added the Idle
struct that can be used in a similar way as Task
.
For example:
Task {
try await Task.sleep(for: .seconds(0.5))
Idle {
someState = false
}
}
There's an example in the demo app, showcasing the usage of the initializer for tasks that run one time and repeating tasks.
Your app project looks very interesting! I'll definitely try it once it's fully functional.
Is your feature request related to a problem? Please describe.
For example, when running a thread that updates a progress bar, the UI crashes because updates are made out of sync with the GTK UI main thread
Describe the solution you'd like
I think an inbuilt scheduler that calls
g_idle_add
,g_main_context_invoke
org_timeout_add
to schedule functions on the main UI thread even from other threads would be neat. Preferably with an API similar to the followingDescribe alternatives you've considered
If this is not possible then some sort of documentation of how to do this would be appreciated, even if "hacky" as I believe any hacky implementation could be wrapped by a proper widget implementation.
Additional context
This is a screenshot of my specific use-case
And here is the error.
I did not want to report this as a bug as this is outside what libadwaita as a UI toolkit does.
Plus this last part is not context per se but I really appreciate the work you've put in to this library and it's documentation as I have been a user since January and have seen how it has evolved.