Tornadofx: how to preview the view in tornadofx

Created on 15 Oct 2019  路  6Comments  路  Source: edvin/tornadofx

are there some tool to preview the view rather than start the tornadofx application?

Most helpful comment

You really don't want that setting in your app when it's distributed to users, so it's better to use the command line parameter --live-views. The TornadoFX plugin can add this command line parameter for you, all you need to do is check the checkbox in the run configuration.

All 6 comments

No, there is not, but you can in many cases turn on live views and see the ui update as you recompile.

No, there is not, but you can in many cases turn on live views and see the ui update as you recompile.
@edvin

How to turn on live views?Could you tell more detail?

get it,thanks!
@edvin

Following is the way to use the alive view.

1.add this code in the app class

class MyApp: App(MainView::class,Styles::class){
    init {
        reloadViewsOnFocus()
    }
}

2.use the debug mode to start the tornadofx application
3.change your view code,press Ctrl+F9 to rebuild the application,then go back the application,you can see the view is changed

You really don't want that setting in your app when it's distributed to users, so it's better to use the command line parameter --live-views. The TornadoFX plugin can add this command line parameter for you, all you need to do is check the checkbox in the run configuration.

You really don't want that setting in your app when it's distributed to users, so it's better to use the command line parameter --live-views. The TornadoFX plugin can add this command line parameter for you, all you need to do is check the checkbox in the run configuration.

I have a try your suggestion and it works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jordaorodolfo picture jordaorodolfo  路  6Comments

ThraaxSession picture ThraaxSession  路  3Comments

elliotcm picture elliotcm  路  7Comments

MairwunNx picture MairwunNx  路  3Comments

Mosch0512 picture Mosch0512  路  4Comments