GoLVS/gui/modules/base/__init__.py
2020-05-30 19:19:14 +02:00

22 lines
492 B
Python

class BaseClass:
def __init__(self, gui):
self.gui = gui
self.drawing = True
async def draw(self):
pass
async def dispatch_event(self, event_type, *args, **kwargs):
try:
coro = self.__getattribute__("on_" + event_type)
except AttributeError:
pass
else:
await coro(*args, **kwargs)
class MainClass(BaseClass):
async def on_pygame_keydown(self, event):
print("prout")