I am wondering whether it is possible to have a “close” button inside a Human UI window to close that same window (i.e. change the “show window” toggle to false)? My intention is that I have a button in another Human UI window that the user can click to open the secondary window, and then hit “close” within the secondary window to hide it again.
I have tried the following definition, and the “Close” button works to close the window, but the problem is that when the window closes the button gets stuck on “True” and does not send the unclick “False” (presumably because the window closes before the unclick).
I’ve tried adding a data dam or a python sleep component to delay the closing of the window until the unclick event has happened, but those methods don’t work. Data dam only sends through the data that exists at the end of the dam interval, so by the time the delay is over the button is unclicked and it only sends through the false. The python sleep method stops all computation so the same problem exists as without it (the button stays pressed during the pause and window closes immediately after the True is sent at the end of the pause). I’m quite a newby with python so forgive me if those things are obvious.
Appreciate any suggestions - thanks!
closeWindow.gh (10.6 KB)