diff --git a/sc8pr/gui/slider.py b/sc8pr/gui/slider.py index 5a67320..8211fe6 100644 --- a/sc8pr/gui/slider.py +++ b/sc8pr/gui/slider.py @@ -57,7 +57,7 @@ def __init__(self, size, colors=None): except: imgs = [Image(size, colors)] super().__init__(imgs) - def ondraw(self, ev=None): + def update(self, ev=None): hov = self is self.sketch.evMgr.hover self.costumeNumber = 1 if hov else 0 # or self.canvas.focussed diff --git a/sc8pr/gui/textinput.py b/sc8pr/gui/textinput.py index 40338a1..5922f31 100644 --- a/sc8pr/gui/textinput.py +++ b/sc8pr/gui/textinput.py @@ -298,7 +298,7 @@ def _scrollCalc(self, a): else: pix = 0 return pix, True - def scroll(self, pix=None, rel=True): + def _scroll(self, pix=None, rel=True): # Calculate scroll when not specified a = self.angle if pix is None: pix = self.focussed and a in (0, 90) @@ -317,7 +317,9 @@ def scroll(self, pix=None, rel=True): else: self.pos = sigma(self.pos, vec2d(pix, a)) return self - def ondraw(self, ev=None): return self.scroll() + def update(self, ev): + self._scroll() + if hasattr(self, "ondraw"): self.ondraw(ev) class TextInputCanvas(Canvas):