def on_mouse_press(self, x, y, buttons, modifiers): x, y = self.calculateRelativeCoords(x, y) r = self.bar.rect if x < r.x: self.stepToMinimum() self.delay_timer = anim.Delayed(self.startRepeat, self.stepToMinimum, delay=.5) elif x > r.right: self.stepToMaximum() self.delay_timer = anim.Delayed(self.startRepeat, self.stepToMaximum, delay=.5) return event.EVENT_HANDLED
def on_mouse_motion(widget, *args): if widget.control.anim is not None: widget.control.anim.cancel() widget.control.setVisible(True) widget.control.anim = anim.Delayed(widget.control.setVisible, False, delay=5) return event.EVENT_HANDLED
def on_mouse_press(self, x, y, buttons, modifiers): self.is_pressed = True if self.delay: self.delay_timer = anim.Delayed(self.startRepeat, delay=self.delay) else: self.startRepeat() self.buttons = buttons self.modifiers = modifiers self.getGUI().dispatch_event(self, 'on_click', x, y, buttons, modifiers, 1) self.is_pressed = True return event.EVENT_HANDLED
def on_text(widget, text): if text == 'f': gui.get('#movie-test').video.pause() anim.Delayed(gui.get('#movie-test').video.play, duration=10) window.set_fullscreen() return event.EVENT_HANDLED
def on_element_enter(widget, *args): widget.control.setVisible(True) widget.control.anim = anim.Delayed(widget.control.setVisible, False, delay=5) return event.EVENT_HANDLED