Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # frame_menu_demo.py
- import wx
- class Test( wx.Frame ):
- def __init__( self, parent ):
- wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Frame Menu Demo", pos = wx.DefaultPosition, size = wx.Size( 300,200 ), style = wx.DEFAULT_FRAME_STYLE )
- self.panel = wx.Panel(self)
- self.status = self.CreateStatusBar( 1, 0, wx.ID_ANY )
- self.menu = wx.MenuBar( 0 )
- self.first = wx.Menu()
- self.new = wx.MenuItem( self.first, wx.ID_ANY, "New", u"Start A New Project", wx.ITEM_NORMAL )
- self.first.AppendItem( self.new )
- self.open = wx.MenuItem( self.first, wx.ID_ANY, "Open...", u"Open A Saved Project", wx.ITEM_NORMAL )
- self.first.AppendItem( self.open )
- self.menu.Append( self.first, "File" )
- self.second = wx.Menu()
- self.aaa = wx.MenuItem( self.second, wx.ID_ANY, "AAA", u"aaa", wx.ITEM_NORMAL )
- self.second.AppendItem( self.aaa )
- self.bbb = wx.MenuItem( self.second, wx.ID_ANY, "BBB", u"bbb", wx.ITEM_NORMAL )
- self.second.AppendItem( self.bbb )
- self.ccc = wx.MenuItem( self.second, wx.ID_ANY, "CCC", u"ccc", wx.ITEM_NORMAL )
- self.second.AppendItem( self.ccc )
- self.menu.Append( self.second, "Menu" )
- self.SetMenuBar( self.menu )
- self.Centre( wx.BOTH )
- if __name__=='__main__':
- app=wx.App()
- frame=Test(None)
- frame.Show()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement