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
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)
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)