alilosoft
04/27/2019, 11:32 AMrunAsync
function, I got the following snippet from the `TornadoFX repo->testapps->AsyncProgressApp.kt`:
kotlin
runAsync {
updateTitle("Doing some work")
for (i in 1..10) {
updateMessage("Working $i...")
if (i == 5) updateTitle("Dome something else")
Thread.sleep(200)
updateProgress(i.toLong(), 10)
}
}
My question is: If I want to move the logic inside runAsync
block to a controller function, then how I could use FXTask
functions like updateTitle(), updateMessage() and updateProegress()
, supposing that I wont move the entire runAsync
block because I want to use it with ui
block?