mirror of
https://github.com/bendtherules/pytry.git
synced 2026-08-18 22:03:03 +00:00
20 lines
624 B
Python
20 lines
624 B
Python
import wx
|
|
class MenuExample(wx.Frame):
|
|
def __init__(self, parent, id, title):
|
|
wx.Frame.__init__(self, parent, id, title, size=(250, 150))
|
|
menubar = wx.MenuBar()
|
|
file = wx.Menu()
|
|
quit = wx.MenuItem(file, 1, 'Qu&it\tCtrl+q \tCtrl+t')
|
|
#quit.SetBitmap(wx.Bitmap('icons/exit.png'))
|
|
file.AppendItem(quit)
|
|
self.Bind(wx.EVT_MENU, self.OnQuit, id=1)
|
|
menubar.Append(file, '&File')
|
|
self.SetMenuBar(menubar)
|
|
self.Centre()
|
|
self.Show(True)
|
|
def OnQuit(self, event):
|
|
self.Close()
|
|
app = wx.App()
|
|
MenuExample(None, -1, '')
|
|
app.MainLoop()
|