示例#1
0
    def __init__(self, experiment, auto_prepare=True, **style_args):

        Canvas.__init__(self,
                        experiment,
                        auto_prepare=auto_prepare,
                        **style_args)
        PsychoCoordinates.__init__(self)
        self.clear()
示例#2
0
    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)
示例#3
0
    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__')
示例#4
0
    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
示例#5
0
    def copy(self, canvas):

        self.surface = canvas.surface.copy()
        Canvas.copy(self, canvas)
示例#6
0
    def set_config(self, **cfg):

        Canvas.set_config(self, **cfg)
        if hasattr(self, u'surface'):
            self.redraw()
示例#7
0
    def lower_to_bottom(self, element):

        Canvas.lower_to_bottom(self, element)
        Canvas.lower_to_bottom(self, u'__background__')
示例#8
0
    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)
示例#10
0
    def set_config(self, **cfg):

        Canvas.set_config(self, **cfg)
        if u'background_color' in cfg:
            self._set_background()