hi, i’m working on a shortcut that shows or hides a dialog. but i notice that if i click on the [X] at the top left corner, nothing happens. i.e. the “dialog has been closed” feature of my dialog is not shot.
how does one detect that [X] has been clicked on, dialog has been closed, and then revert to “dialog is not open”, so that the next time you run the shortcut, the dialog is opened? currently if i click on [X] to close, i need to run the shortcut two times - which means that on the first run, it seems the feature is broken.
I have this almost transparent, except for the [X]. any ideas?
Not sure about catching the close event but you shouldn’t keep a separate boolean or something to keep track of the dialog state. Instead keep a reference to the dialog itself and check if its visible is true, if not, you can create a new one when executing the shortcut.