Ejemplo n.º 1
0
 def updateFocus(self):
     Updatable.updateFocus(self)
     if self.canFocus and not Updatable._focusIsChecked:
         if self.canUpdate and self.howFocus():
             Widget.widgetFocus = self
             Updatable._focusIsChecked = True
             return
Ejemplo n.º 2
0
    def update(self, render=None):
        if self.canUpdate:
            if self._event and self.isMoving:
                self.move(render.convertScreenCoordToTargetPoint(\
                        self._event.mousePos - self._mousePosMoving))
                self._mousePosMoving = self._event.mousePos

            self.clear(self.backgroundColor)
            Updatable.updateFocus(self)
            Updatable.update(self)
            self.display()
            if render:
                render.draw(self._frameSprite)
Ejemplo n.º 3
0
    def update(self):
        """Update the Window. It Update all event, and update framerate.
        It Draw and display also all widgets child"""
        if self.canUpdate:
            self._event.update()
            self._framerate = 1/(self._event.elapsedTime*10**-6)

            if self._event.isResize:
                Render._setSize(self,self.size)

            if self.event._mouseMoved:
                Widget.widgetFocus = None
    
            if self.event._mouseMoved and self.event.isMouseInRect(self.rect):
                Updatable._focusIsChecked= False
                Updatable.updateFocus(self)
            Widget.update(self, self)
            self.display()
            self.clear(self.backgroundColor)