def toggle(self):
        """ Toggles the visibility of this windows """
        if self._visible:
            self.hide()
        else:
            self._populate_content()
            self.show()
 Toggles the visibility of this windows 
metadrive/render_pipeline/rpcore/gui/render_mode_selector.py