Need a way to call tomo.Stop when all windows have closed #5
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the pattern is for the application to count how many windows are open. If not done exactly right we get zombie processes. Behaviors of the Application interfaces must return a Window that can be counted by Nasin, which will then call tomo.Stop once no windows are open.
7da00e990e
The current solution is actually bad. What if the application wants to open another window (like middle clicking in a file manager)?
There needs to be some sort of nasin.Manage function that takes in a window, and will return a cookie that unmanages it. The function will increment the window counter when called, and decrement it when the window is closed, then checking if it is zero to call tomo.Stop if need be.
Perhaps instead of accepting a window, it could accept a Manageable interface with an OnClose behavior. This would allow applications to do things like keep a background service running to receive notifications or something like that.
On second thought, the Manageable interface would be a very bad idea. It would be very bug prone in terms of goroutines.