Commit 38be1c43 authored by Jasmin Jutila's avatar Jasmin Jutila
Browse files

Delete gui.py

parent 987acd61
from PyQt5 import QtWidgets, QtCore, QtGui
class GUI(QtWidgets.QMainWindow):
'''
The class GUI handles the drawing of a RobotWorld and allows user to
interact with it.
'''
def __init__(self, world, square_size):
super().__init__()
self.setCentralWidget(QtWidgets.QWidget()) # QMainWindown must have a centralWidget to be able to add layouts
self.horizontal = QtWidgets.QHBoxLayout() # Horizontal main layout
self.centralWidget().setLayout(self.horizontal)
self.world = world
self.square_size = square_size
self.init_window()
self.init_buttons()
self.add_start_view()
self.add_robot_graphics_items()
self.update_robots()
# Set a timer to call the update function periodically
self.timer = QtCore.QTimer()
self.timer.timeout.connect(self.update_robots)
self.timer.start(10) # Milliseconds
def add_start_view(self):
light_gray = QColor(211, 211, 211)
dark_gray = QColor(20, 20, 20)
korkeus = self.robot_world.get_height()
leveys = self.robot_world.get_width()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment