def __init__(self, parent, title, size=(200,100)):
# Initialize super class
wx.Frame.__init__(self, parent, title=title, size=size)
# Change the frame color
self.SetBackgroundColour('white')
# Create Status Bar
self.CreateStatusBar()
# Create the Menu
menu= wx.Menu()
# Add Menu Items to the Menu
menu.Append(wx.ID_ABOUT, "About", "wxPython GUI")
menu.AppendSeparator()
menu.Append(wx.ID_EXIT,"Exit"," Exit the GUI")
# Create the MenuBar
menuBar = wx.MenuBar()
# Give the Menu a Title
menuBar.Append(menu,"File")
# Connect the Menu to the frame
self.SetMenuBar(menuBar)
# Display the frame
self.Show()
# Create instance of wxPython application
wxPython_frame_GUI.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录