def __init__(self, experiment, auto_prepare=True, **style_args): Canvas.__init__(self, experiment, auto_prepare=auto_prepare, **style_args) PsychoCoordinates.__init__(self) self.clear()
def prepare(self): """ desc: Finishes pending canvas operations (if any), so that a subsequent call to [canvas.show] is extra fast. It's only necessary to call this function if you have disabled `auto_prepare` in [canvas.__init__]. """ self.surface.fill(self.background_color.backend_color) Canvas.prepare(self)
def _set_background(self): if u'__background__' in self: del self['__background__'] self['__background__'] = Rect(self.left, self.top, self.width, self.height, color=self.background_color.colorspec, fill=True) Canvas.lower_to_bottom(self, u'__background__')
def __init__(self, experiment, auto_prepare=True, **style_args): Canvas.__init__(self, experiment, auto_prepare=auto_prepare, **style_args) LegacyCoordinates.__init__(self) self.antialias = True self.surface = self.experiment.surface.copy() self.clear() if platform.system() == u'Darwin': self.show = self._show_macos
def copy(self, canvas): self.surface = canvas.surface.copy() Canvas.copy(self, canvas)
def set_config(self, **cfg): Canvas.set_config(self, **cfg) if hasattr(self, u'surface'): self.redraw()
def lower_to_bottom(self, element): Canvas.lower_to_bottom(self, element) Canvas.lower_to_bottom(self, u'__background__')
def set_config(self, **cfg): Canvas.set_config(self, **cfg) if u'background_color' in cfg and hasattr(self, u'_elements'): self._set_background()
def __init__(self, experiment): Canvas.__init__(self, experiment) Coordinates.__init__(self)
def set_config(self, **cfg): Canvas.set_config(self, **cfg) if u'background_color' in cfg: self._set_background()