def visible(self, visible):
        """When visible changed, do setup or unwatch and call visible_callback"""
        self._visible = visible
        if visible and len(self.panel.objects) == 0:
            self.setup()
            self.panel.extend(self.children)
        elif not visible and len(self.panel.objects) > 0:
            self.unwatch()
            self.panel.clear()
        if self.visible_callback:
            self.visible_callback(visible)
def visible ( self , visible ) : self . _visible = visible if visible and len ( self . panel . objects ) == 0 : self . setup ( ) self . panel . extend ( self . children ) elif not visible and len ( self . panel . objects ) > 0 : self . unwatch ( ) self . panel . clear ( ) if self . visible_callback : self . visible_callback ( visible )
When visible changed, do setup or unwatch and call visible_callback