I have two functions. i want to exit the first one when the second one is running.
code
import wx
class MyFrame(wx.Frame):
def init(self):
super().init(parent=None, title=‘Simple App’)
panel = wx.Panel(self)
def OnInput(event):
#static text
text = wx.StaticText(panel, label ="Type your text", pos =(50, 100))
#input text
type = wx.TextCtrl(panel, pos = (50, 150))
def OnReadonly(event):
#static text
text = wx.StaticText(panel, label ="Status", pos =(50, 100))
#input text
input = wx.TextCtrl(panel, pos = (50, 150), style=wx.TE_MULTILINE|wx.TE_READONLY)
input.SetValue("Waiting for your file")
menu = wx.Menu()
it = menu.Append(-1, "Input Text")
menu.AppendSeparator()
rt = menu.Append(-1, "Readonly Text")
self.Bind(wx.EVT_MENU, OnInput, it)
self.Bind(wx.EVT_MENU, OnReadonly, rt)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Simple Menu")
self.SetMenuBar(menuBar)
self.Show()
if name == ‘main’:
app = wx.App()
frame = MyFrame()
app.MainLoop()