Come faccio a tradurre ....se il pulsante "X" è stato cliccato fallo sparire...

if btn_X on Press
else btn_X= false

ma è corretto?