Edit method setOnWindowCloseCalback