<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I'm trying some of the zetcode tutorials. How come no menu item shows up on my Macbook when I execute the following?</div><div><br></div><div><span class="Apple-style-span" style="font-family: verdana; font-size: 13px; line-height: 24px; "><pre class="code" style="line-height: 1.4; margin-top: 25px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: rgb(176, 235, 255); border-right-color: rgb(176, 235, 255); border-bottom-color: rgb(176, 235, 255); border-left-color: rgb(176, 235, 255); padding-top: 15px; padding-right: 15px; padding-bottom: 15px; padding-left: 15px; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(241, 241, 241); color: black; position: static; z-index: auto; "># menubar.py
import sys
from PyQt4 import QtGui, QtCore
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.resize(250, 150)
self.setWindowTitle('menubar')
exit = QtGui.QAction(QtGui.QIcon('icons/exit.png'), 'Exit', self)
exit.setShortcut('Ctrl+Q')
exit.setStatusTip('Exit application')
self.connect(exit, QtCore.SIGNAL('triggered()'), QtCore.SLOT('close()'))
self.statusBar()
menubar = self.menuBar()
file = menubar.addMenu('&File')
file.addAction(exit)
app = QtGui.QApplication(sys.argv)
main = MainWindow()
main.show()
sys.exit(app.exec_())</pre></span><div><br></div></div></body></html>