board.py 437 Bytes
Newer Older
Fedrico Otaran's avatar
Fedrico Otaran committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import PySimpleGUI as sg
from src.windows import board


def start():
    window = loop()
    window.close()


def loop():
    window = board.build("Fede", "Milka")

    while True:
        event, _values = window.read()

        if event in (sg.WINDOW_CLOSED, "Exit", "-exit-"):
            break

        if event.startswith("cell"):
            _prefix, x, y = event.split("-")
            print(f"Celda: {x},{y}")

    return window