asticode / go-astilectron

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not relaunch window after w.Close()

Dontmindmes opened this issue · comments

Hello,

I encounter an issue, when i create a window for example "w.Create()" and i display the window because it was created, and i close it so its no longer visible and attempt to call the same window "w" from one of my other windows it does not let me "w.Create()" or "w.Show()" the window after i run "w.Close()", how can i display the window again after closing it?

Thank you

Once the window is closed, you can't reuse it. What you seem to be looking to do instead is hiding the windows instead of closing it.

But when i use hide and all windows are closed through the close button at the frame the program keeps running because the window is hidden

If you use the window closed and hide event, you can know which of your windows are closed and hidden. Then, based on this info, when you think the program should be closed, you can use the Stop method to stop the program.