Example #1
0
    def _loop(self) -> None:
        while True:
            self._net_io.check()

            while Event.ready():
                e = Event.next()

                if e.target:
                    e.target.on_event(e)
                else:
                    self.on_event(e)
Example #2
0
    def _loop(self) -> None:
        while True:
            if self._dirty:
                self.paint()

            self._check_input()

            while Event.ready():
                e = Event.next()

                if e.type == Event.EXIT:
                    exit()
                elif e.target:
                    e.target.on_event(e)
                else:
                    self.on_event(e)

                self._dirty = True

            OutStream.instance('').write(self._socket)