try onCloseRequest on the modalStage variable
# tornadofx
c
try onCloseRequest on the modalStage variable