Could be nice one-liner:
menu.setVisible not menu.isVisible()