fix #1307 Dialog onClose callback

This fix adds the possibility to call a callback everytime the Dialog widget is closed.