Hello!
How can I change the default text in a TextCtrl?
I have tested the SetLabel function, but it didn't work. Do I have to create
a new TextControl object? Didn't see any obvious functions in the Window class
either. But, I could of course have missed it.
Oerjan...
···
#################################################
#!/usr/bin/python
#10_panelupdate.py
import wx
import wx.lib.inspection
class MyFrame(wx.Frame):
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
self.p1 = wx.Panel(self)
st = wx.TextCtrl(self.p1, -1, 'String')
st.SetLabel('Another string')
# st = wx.TextCtrl(self.p1, -1, 'Another string')
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, '10_panelupdate.py')
frame.Show()
self.SetTopWindow(frame)
return 1
if __name__ == "__main__":
app = MyApp(0)
# wx.lib.inspection.InspectionTool().Show()
app.MainLoop()