def _set_launcher(self): launcher = launchmod.Launcher(self.launched, launching=self) reac_enter = ConstantReaction(constants.THORPY_EVENT, launcher.launch, { "id": constants.EVENT_UNPRESS, "el": self }) ## reac_name="reac_launch") reac_done = ConstantReaction(constants.THORPY_EVENT, self.unlaunch, { "id": constants.EVENT_DONE, "el": self.launched }, {"what": DONE}) ## reac_name="reac_done") reac_cancel = ConstantReaction(constants.THORPY_EVENT, self.unlaunch, { "id": constants.EVENT_CANCEL, "el": self.launched }, {"what": CANCEL}) ## reac_name="reac_cancel") if self.click_cancel: reac_click_cancel = Reaction(parameters.MOUSEBUTTONUP, launchmod.func_click_quit, params={ "launcher": self, "what": CLICK_QUIT }, reac_name="reac_click_cancel") self.launched.add_reaction(reac_click_cancel) self.add_reaction(reac_enter) self.launched.add_reaction(reac_done) self.launched.add_reaction(reac_cancel) self.launcher = launcher
def _set_launcher(self): launcher = launchmod.Launcher(self.launched, launching=self) reac_enter = ConstantReaction(constants.THORPY_EVENT, launcher.launch, { "id": constants.EVENT_UNPRESS, "el": self }) ## reac_name="reac_launch") reac_done = ConstantReaction(constants.THORPY_EVENT, self._unlaunch_done, { "id": constants.EVENT_DONE, "el": self.launched }) ## reac_name="reac_done") reac_cancel = ConstantReaction(constants.THORPY_EVENT, self._unlaunch_cancel, { "id": constants.EVENT_CANCEL, "el": self.launched }) ## reac_name="reac_cancel") if self.click_cancel: reac_click_cancel = Reaction(parameters.MOUSEBUTTONUP, self._unlaunch_click_cancel, params={"launcher": launcher}) ## reac_name="reac_click_cancel") self.launched.add_reaction(reac_click_cancel) self.add_reaction(reac_enter) self.launched.add_reaction(reac_done) self.launched.add_reaction(reac_cancel) self.launcher = launcher
def _set_launcher(self): launcher = launchmod.Launcher(self.launched, launching=self) reac_enter = ConstantReaction(constants.THORPY_EVENT, launcher.launch, { "id": constants.EVENT_UNPRESS, "el": self }) ## reac_name="reac_launch") reac_done = ConstantReaction(constants.THORPY_EVENT, self.unlaunch, { "id": constants.EVENT_DDL, "el": self.launched }) ## reac_name="reac_done") if self.click_cancel: reac_cancel = Reaction(parameters.MOUSEBUTTONUP, launchmod.func_click_quit, params={ "launcher": launcher, "what": CLICK_QUIT }) ## reac_name="reac_cancel") self.launched.add_reaction(reac_cancel) self.add_reaction(reac_enter) self.launched.add_reaction(reac_done) def func_before(): self.launched.stick_to(self, "bottom", "top") self.launched.blit() self.launched.update() launcher.func_before = func_before self.launcher = launcher