ID:160407
 
Is there a way of detecting when a player closes a window, yet? Has this been suggested?
Yes. Check the window's is-visible variable. When it's "false", the window has closed.
In response to Xooxer
if(winget(src,"WindowName","is-visible") == "false")


EDIT: Thanks Nadrew.
In response to SubZeroChaos
Not quite, winget() doesn't return boolean, it returns a string, you'd have to check it against "true" or "false" (strings, not boolean).
In response to Nadrew
Oh right. Dur. I knew that. >.>
You could mimic the "[X]" button at the top of the screen (just using printscreen and making an image using it would work fine). Tie the button to a verb and then that verb would indicate when the window was closed. This is assuming you meant a way of signallying when the window closes, not if it has been closed.
In response to Popisfizzy
Unfortunately, you then have to mimic all three buttons, which is much harder to do. I tried it, using winget() in a loop is much easier.
In response to Xooxer
Or you could put a non-visible browser on the window and use javascript to call Topic() when it gets closed.
I should've capitalized WHEN and made mention that I specifically wanted to detect a window close event rather than if a window is closed. Thanks Nadrew, that sounds like a decent idea there. Although, it would be nice if this were built in, so, I'm going to take this to feature requests.