1mainMenu = self.menuBar()fileMenu = mainMenu.addMenu('File')editMenu = mainMenu.addMenu('Edit')viewMenu = mainMenu.addMenu('View')searchMenu = mainMenu.addMenu('Search')toolsMenu = mainMenu.addMenu('Tools')helpMenu = mainMenu.addMenu('Help')
1#!/usr/bin/python
2
3"""
4ZetCode PyQt5 tutorial
5
6This program creates a statusbar.
7
8Author: Jan Bodnar
9Website: zetcode.com
10"""
11
12import sys
13from PyQt5.QtWidgets import QMainWindow, QApplication
14
15
16class Example(QMainWindow):
17
18 def __init__(self):
19 super().__init__()
20
21 self.initUI()
22
23 def initUI(self):
24 self.statusBar().showMessage('Ready')
25
26 self.setGeometry(300, 300, 250, 150)
27 self.setWindowTitle('Statusbar')
28 self.show()
29
30
31def main():
32 app = QApplication(sys.argv)
33 ex = Example()
34 sys.exit(app.exec_())
35
36
37if __name__ == '__main__':
38 main()
39