Hi - I have tried and tried with this, googled and what knot, but to no avail.
I just need the frame to clear. The code below shows the overlay problem which I tried clearing with all types of panel.Clear() / self.panel.Clear() combos etc.
import wx
class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(400, 200))
panel=wx.Panel(self)
wx.StaticText(panel, -1, "Main Frame...", (10,10))
menuBar = wx.MenuBar()
menu1 = wx.Menu()
menu1.Append(101, "Text 1", "Text1")
menu1.AppendSeparator()
menu1.Append(102, "Text 2", "Text2")
menuBar.Append(menu1, "&File")
self.SetMenuBar(menuBar)
self.Bind(wx.EVT_MENU, self.ChangeText1, id=101)
self.Bind(wx.EVT_MENU, self.ChangeText2, id=102)
def ChangeText1(self, event):
#self.panel.Clear()
wx.StaticText(self, -1, "text1", (10,10))
def ChangeText2(self, event):
#self.panel.Clear()
wx.StaticText(self, -1, "text2", (10,10))
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, 'Main Frame')
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MyApp(0)
app.MainLoop()
Many thanks for any help - cheers.