- 论坛徽章:
- 2
|
如题,有一个简单的例子程序:
- import wx
- class MainWindow(wx.Frame):
- def __init__(self, parent, title):
- wx.Frame.__init__(self, parent, title=title, size=(200,100))
- self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
- self.CreateStatusBar() # A Statusbar in the bottom of the window
- # Setting up the menu.
- filemenu= wx.Menu()
- # wx.ID_ABOUT and wx.ID_EXIT are standard IDs provided by wxWidgets.
- filemenu.Append(wx.ID_ABOUT, "&About"," Information about this program")
- filemenu.AppendSeparator()
- filemenu.Append(wx.ID_EXIT,"E&xit"," Terminate the program")
- # Creating the menubar.
- menuBar = wx.MenuBar()
- menuBar.Append(filemenu,"&File") # Adding the "filemenu" to the MenuBar
- self.SetMenuBar(menuBar) # Adding the MenuBar to the Frame content.
- self.Show(True)
- app = wx.App(False)
- frame = MainWindow(None, "Sample editor")
- app.MainLoop()
复制代码
执行的结果如下图:
为什么不能显示呢?
|
|