def METHOD_NAME(self):
    def hook_change(name, selection):
        if name != self.selection:
            return
        if self.is_blacklisted(selection["owner"]):
            text = self.blacklist_text
        else:
            text = selection["selection"].replace("\n", " ")
            text = text.strip()
            if self.max_width is not None and len(text) > self.max_width:
                text = text[: self.max_width] + "..."
        self.text = pangocffi.markup_escape_text(text)
        if self.timeout_id:
            self.timeout_id.cancel()
            self.timeout_id = None
        if self.timeout:
            self.timeout_id = self.timeout_add(self.timeout, self.clear)
        self.bar.draw()
    def hook_notify(name, selection):
        if name != self.selection:
            return
        if self.timeout_id:
            self.timeout_id.cancel()
            self.timeout_id = None
        # only clear if don't change don't apply in .5 seconds
        if self.timeout:
            self.timeout_id = self.timeout_add(self.timeout, self.clear)
        self.bar.draw()
    hook.subscribe.selection_notify(hook_notify)
    hook.subscribe.selection_change(hook_change)