diff --git a/exit.png b/exit.png new file mode 100644 index 0000000..a44566f Binary files /dev/null and b/exit.png differ diff --git a/view.py b/view.py new file mode 100644 index 0000000..c7c5b87 --- /dev/null +++ b/view.py @@ -0,0 +1,47 @@ +import sys +from PyQt4 import QtGui + +class View(QtGui.QMainWindow): + + def __init__(self): + + super(View, self).__init__() + self.initUI() + + def initUI(self): + + text = QtGui.QTextEdit() + + self.setCentralWidget(text) + + exit = QtGui.QAction(QtGui.QIcon('exit.png'), 'Quit', self) + exit.setStatusTip('Exit') + exit.triggered.connect(self.close) + exit.setShortcut('Ctrl+Q') + + self.statusBar() + menubar = self.menuBar() + menu = menubar.addMenu('&File') + menu.addAction(exit) + + toolbar = self.addToolBar('Quit') + toolbar.addAction(exit) + + self.setGeometry(300, 400, 300, 270) + self.setWindowTitle('A GUI App') + self.show() + + text = QtGui.QTextEdit('When in the chronicle of wasted time, I see descriptions of the fairest wights, and beauty making beautiful old rhyme') + textBlock = QtGui.QTextBlock() + self.setCentralWidget(text) + + +def main(): + app = QtGui.QApplication(sys.argv) + + view = View() + + sys.exit(app.exec_()) + +if __name__ == '__main__': + main() \ No newline at end of file