(self)
return self
Removes this component from the component tree.

        Removing a component from the component tree is a two stage process.
        First, the component is marked as to be removed, which prevents it
        from receiving further events, and a
        :class:`~.components.prepare_unregister` event is fired. This
        allows other components to e.g. release references to the component
        to be removed before it is actually removed from the component tree.

        After the processing of the ``prepare_unregister`` event has completed,
        the component is removed from the tree and an
        :class:`~.events.unregistered` event is fired.
Removes this component from the component tree.
Removes this component from the component tree .
def unregister(self):
        """
        Removes this component from the component tree.

        Removing a component from the component tree is a two stage process.
        First, the component is marked as to be removed, which prevents it
        from receiving further events, and a
        :class:`~.components.prepare_unregister` event is fired. This
        allows other components to e.g. release references to the component
        to be removed before it is actually removed from the component tree.

        After the processing of the ``prepare_unregister`` event has completed,
        the component is removed from the tree and an
        :class:`~.events.unregistered` event is fired.
        """

        if self.unregister_pending or self.parent is self:
            return self

        # tick shouldn't be called anymore, although component is still in tree
        self._unregister_pending = True
        self.root._cache_needs_refresh = True

        # Give components a chance to prepare for unregister
        evt = prepare_unregister(self)
        evt.complete_channels = (self,)
        self.fire(evt)

        return self
def unregister ( self ) : if self . unregister_pending or self . parent is self : return self # tick shouldn't be called anymore, although component is still in tree self . _unregister_pending = True self . root . _cache_needs_refresh = True # Give components a chance to prepare for unregister evt = prepare_unregister ( self ) evt . complete_channels = ( self , ) self . fire ( evt ) return self