@stantonxu I think the platforms treat window/app differently. At first I tried implementing on_exit in the app code, when app exits. However, at that moment in windows the widgets are disposed of, so I couldn't get the text of the multilinetextinput when I added the handler to winforms.app exit handler. That's why I added the handler to winforms_onFormClosing. On Winforms the app exits if you click on 'x'. I'm not sure, but if Cocoa doesn't dispose of the widgets when the window is closed, implementing on_exit handler on the app would be a simpler and better solution.