37,719
社区成员
发帖
与我相关
我的任务
分享
import wx
class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None)
self.contol = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.contol.LoadFile(__file__)
menubar = wx.MenuBar()
menu = wx.Menu()
menu.Append(101, 'Read Only\tCtrl+I', kind=wx.ITEM_CHECK)
menubar.Append(menu, '&Options')
self.SetMenuBar(menubar)
self.Bind(wx.EVT_MENU, self.OnImode, id=101)
def OnImode(self, event):
self.contol.SetEditable(not event.IsChecked())
app = wx.App(False)
frame = TestFrame()
frame.Show()
app.MainLoop()