import wx
class FrontMenu(wx.Frame):
def __init__(self, parent, title):
super(FrontMenu, self).__init__(parent, title=title, size=(400, 300))
self.InitUI()
self.Centre()
self.Show()
def InitUI(self):
menubar = wx.MenuBar()
fileMenu = wx.Menu()
menubar.Append(fileMenu, '&File')
self.SetMenuBar(menubar)
vbox = wx.BoxSizer(wx.VERTICAL)
gs = wx.GridSizer(4, 1, 0, 0)
gs.AddMany([
(wx.Button(self, label='Create New Audit.'), 0, wx.EXPAND),
(wx.Button(self, label='View Previous Audits.'), 0, wx.EXPAND),
(wx.Button(self, label='Add New Engineer.'), 0, wx.EXPAND),
(wx.Button(self, label='Close Application.'), 0, wx.EXPAND)
])
When using the AddMany method how do I capture button events? I can achieve this when I add the buttons 1 at a time.
Thanks Paul
That pointed me in the right direction. Below is the code that now works.
Thanks