示例#1
0
class MainWindow(QtGui.QMainWindow):
	def __init__(self):

		"""
		Initialization of MainWindow.
		Geometry is set to 180*380.
		Window title ie set to 'Tetris'.
		Window will appear in the center using self.center().
		"""

		QtGui.QMainWindow.__init__(self)

		self.setGeometry(300, 300, 180, 380)
		self.setWindowTitle('Tetris')

		self.tetrisboard = 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()

	def center(self):
		screen = QtGui.QDesktopWidget().screenGeometry()
		size = self.geometry()
		self.move(
			(screen.width() - size.width()) / 2,
			(screen.height() - size.height()) / 2
		)
示例#2
0
class MainWindow(QtGui.QMainWindow):
    def __init__(self):
        """
		Initialization of MainWindow.
		Geometry is set to 180*380.
		Window title ie set to 'Tetris'.
		Window will appear in the center using self.center().
		"""

        QtGui.QMainWindow.__init__(self)

        self.setGeometry(300, 300, 180, 380)
        self.setWindowTitle('Tetris')

        self.tetrisboard = 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()

    def center(self):
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2,
                  (screen.height() - size.height()) / 2)
示例#3
0
    def __init__(self):
        """
		Initialization of MainWindow.
		Geometry is set to 180*380.
		Window title ie set to 'Tetris'.
		Window will appear in the center using self.center().
		"""

        QtGui.QMainWindow.__init__(self)

        self.setGeometry(300, 300, 180, 380)
        self.setWindowTitle('Tetris')

        self.tetrisboard = 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()
示例#4
0
	def __init__(self):

		"""
		Initialization of MainWindow.
		Geometry is set to 180*380.
		Window title ie set to 'Tetris'.
		Window will appear in the center using self.center().
		"""

		QtGui.QMainWindow.__init__(self)

		self.setGeometry(300, 300, 180, 380)
		self.setWindowTitle('Tetris')

		self.tetrisboard = 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()