import wx class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Title.xom', size=(600, 400)) pos1 = 10 panel = wx.Panel(self) button = wx.Button(panel, label='Touch Me', pos=(pos1, 10), size=(60, 30)) self.Bind(wx.EVT_BUTTON, self.closebutton, button) self.Bind(wx.EVT_CLOSE, self.closewindow) status = self.CreateStatusBar() menubar = wx.MenuBar() first = wx.Menu() second = wx.Menu() first.Append(wx.NewId(), "New Window", "This is a new window") second.Append(wx.NewId(), "Open", "This will open me... :)") menubar.Append(first, "File") menubar.Append(second, "Edit") self.SetMenuBar(menubar) def closebutton(self, event): self.Close(True) def closewindow(self, event): self.Destroy() app = wx.App() frame = bucky(parent=None, id=-1) frame.Show() app.MainLoop()
Python | wxPython
I'm just gonna leave this here...