rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.51k stars 401 forks source link

Why is on_close not called when the browser tab is closed? #422

Closed occoder closed 3 years ago

occoder commented 3 years ago

In the widget_overview_app.py, the on_close function is supposed to be called when the browser tab is closed. But it turns out the on_close function is not called as the time counting continues no matter if the client browser is closed or not. Do I misinterpret the intention behind on_close function? Thanks

occoder commented 3 years ago

And I'd like to implement emitting certain button click event (or calling the click binding function directly) upon when the last browser tab is closed. Is this possible?

dddomodossola commented 3 years ago

Hello @occoder ,

App.on_close is called on app termination, it means the process termination. You maybe need this https://github.com/dddomodossola/remi/blob/master/examples/onclose_window_app.py .

Have a nice day