-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtetris.py
More file actions
29 lines (23 loc) · 878 Bytes
/
tetris.py
File metadata and controls
29 lines (23 loc) · 878 Bytes
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
#coding=utf-8
#!/usr/bin/python
# tetris.py
import board
from PyQt4 import QtCore, QtGui
class Tetris(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.setGeometry(300, 300, 180, 380)
self.setWindowTitle('Tetris')
self.tetrisboard = board.Board(self)
self.setCentralWidget(self.tetrisboard)
self.statusbar = self.statusBar()
self.connect(self.tetrisboard, QtCore.SIGNAL("messageToStatusbar(QString)"),
self.statusbar, QtCore.SLOT("showMessage(QString)"))
self.tetrisboard.start()
self.center()
#sys.exit(app.exec_())
def center(self):
screen = QtGui.QDesktopWidget().screenGeometry()
size = self.geometry()
self.move((screen.width() - size.width()) / 2,
(screen.height() - size.height()) / 2)