def switch(self, value):
     if value:
         WidgetHandler.add_widget(self)
         Renderer.add_widget(self)
     else:
         WidgetHandler.del_widget(self)
         Renderer.del_widget(self)
 def switch(self, event):
     if event.data['instance'] == 'MainTB':
         if event.data['value'] is False:
             WidgetHandler.add_widget(self)
             Renderer.add_widget(self)
         else:
             WidgetHandler.del_widget(self)
             Renderer.del_widget(self)
 def switch(self, event):
     instance = System.MAIN_TB if event.data[
         'instance'] == 'MainTB' else event.data['instance']
     if instance is self:
         if event.data['value'] is True:
             WidgetHandler.add_widget(self)
             Renderer.add_widget(self)
             EventHandler.register(self.filter, 'Key')
             self.cursor.switch(True)
         else:
             self.return_text()
             self.clear()
             WidgetHandler.del_widget(self)
             Renderer.del_widget(self)
             EventHandler.deregister(self.filter, 'Key')
             self.cursor.switch(False)
 def on_mouseup(self, event):
     self.rect.normalize()
     EventHandler.trigger('EndSelection', 'SelectionObject',
                          {'value': False})
     Renderer.del_widget(self)
     WidgetHandler.del_widget(self)
 def remove(self):
     Renderer.del_widget(self)
     WidgetHandler.del_widget(self)
 def kill(self):
     WidgetHandler.del_widget(self)
     Renderer.del_widget(self)
     super().kill()