I installed 2.9.3.1 version in order to work below code
this code is not work well on 2.8.11.0 and 2.9.2.4 version.
but after I install new version, I still cannot see the menubar.
how can I fix this?
#!/usr/bin/env python
WXVER = '2.9.3'
import wxversion
wxversion.select(WXVER)
import wx
class MyFrame(wx.Frame):
""" We simply derive a new class of 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)
menubar = wx.MenuBar()
menu1 = wx.Menu()
menubar.Append(menu1, "&File")
menu1.Append(wx.ID_ANY, "&New", "")
menu1.Append(wx.ID_ANY, "O&pen", "")
menu1.Append(wx.ID_ANY, "Save", "")
menu1.Append(wx.ID_ANY, "SaveAs", "")
menu1.AppendSeparator()
menu1.Append(wx.ID_ANY, "&Exit", "")
menu2 = wx.Menu()
menu2.Append(wx.ID_ANY, "&Copy", "Copy in status bar")
menu2.Append(wx.ID_ANY, "C&ut", "")
menu2.Append(wx.ID_ANY, "Paste", "")
menu2.AppendSeparator()
submenu = wx.Menu()
submenu.Append(wx.ID_ANY, "&Options", "")
menu2.AppendMenu(wx.ID_ANY, "&Lexer", submenu)
menubar.Append(menu2, "&Edit")
self.SetMenuBar(menubar)
self.Show(True)
app = wx.App(False)
frame = MyFrame(None, 'Small editor')
app.MainLoop()
Wonjun, Choi