-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI.py
31 lines (25 loc) · 930 Bytes
/
GUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from PySide6 import QtCore, QtWidgets, QtGui
from GUIFIeld import GUIField
from Config import Config
class GUI(QtWidgets.QWidget):
layout = None
field_widget = None
config = None
simulation = None
def __init__(self, config, simulation):
super().__init__()
self.config = config
self.set_layout()
self.simulation = simulation
self.init_ui(simulation)
def set_layout(self):
self.layout = QtWidgets.QVBoxLayout()
self.setLayout(self.layout)
def init_ui(self, simulation):
self.layout.addWidget(GUIField(
simulation,
int(self.config.data["GUI"]["work_field_height"]),
int(self.config.data["GUI"]["work_field_width"])))
start_stop_button = QtWidgets.QPushButton("start / stop")
start_stop_button.clicked.connect(simulation.switch_state)
self.layout.addWidget(start_stop_button)