def detach(self): """Detach a object vinculated to a ObjectManager object by attach function. Called automatic from UIManager.remove function. """ if self._attached_to is None: return # print ('DETACHING...') try: OM = ObjectManager() OM.unsubscribe(self._check_OM_removals, 'pre_remove') # print ('DETACHED {} FROM {}! \n'.format(self.uid, self._attached_to)) self._attached_to = None except Exception as e: print('ERROR WHILE DETACHING:', e)
def PreDelete(self): OM = ObjectManager() OM.unsubscribe(self._on_OM_object_added, 'add') OM.unsubscribe(self._on_OM_object_removed, 'post_remove')
def _on_OM_add(self, objuid): if objuid != self.uid: return OM = ObjectManager() OM.unsubscribe(self._on_OM_add, 'add')