call GO function when closing application window #2958
Replies: 2 comments 1 reply
-
One of the app options is You give it a function, such as the beforeClose example, that will run just as the window is about to be closed. Depending on the template you used to create your Wails app, you might already have a function already hooked up to In a similar vein, there's an OnShutdown function option that is called after the frontend has been destroyed and the application is about to fully quit, which might be more apt if just doing some silent cleanup. |
Beta Was this translation helpful? Give feedback.
-
Thank you, it worked perfectly. Remember to put it in main.go |
Beta Was this translation helpful? Give feedback.
-
Friends, I created a program here that uses some temporary files in its execution, I would like to make it so that when I click on close the window, these files are cleaned, is it possible to do this? Do you have any example of how you could call functions in Go when you close the window?
Beta Was this translation helpful? Give feedback.
All reactions