check whether Gadget is Valid / Exists?

BlitzMax Forums/MaxGUI Module/check whether Gadget is Valid / Exists?

time-killer-games(Posted 2014) [#1]
Is there a way to do this? I'm in dire need of a means to check whether a gadget has been closed/freed or is still opened/existent.

Thanks.


jsp(Posted 2014) [#2]
Button:TGadget = CreateButton(...)
If Button
Print "available"
Else
Print "gone"
end if

If it is shown/hidden or enabled/disabled is something different.
Check commands GadgetHidden( Button ) and GadgetDisabled( Button ) for this.


time-killer-games(Posted 2014) [#3]
Edit: Nevermind it works! Thank you! :D