Dear Reader,
maybe some of you could give me a small hint or even better a few lines of working demo-code:
My example code is:
#__________Example Code_____________
import wx
class CanvasFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None,-1,
'CanvasFrame',size=(250,250))
#setting up the 3 StaticText Items
IDList = []
posx = 0
for item in range(3):
txt=wx.StaticText(parent = self,
id = -1,
label = "TEST",
pos = wx.Point(posx, 0),
size = wx.Size(50, 50),
style = 0,
name = "staticText")
posx = posx + 50
IDList.append(txt.GetId())
# PROBLEM: Changeing the 3 Labels ??? I do not know
#firstStaticTxtID = IDList[0]
#print firstStaticTxtID
#firstStaticTxtID.SetLabel("eee") # not working
#txt.SetLabel("EE") # this changes just the last label
class App(wx.App):
def OnInit(self):
frame = CanvasFrame()
frame.Show(1)
return 1
app = App(0)
app.MainLoop()
#__________Example Code_____________
Can anyone tell me how to change all three label to::
1. "HELP"
2. "ME"
3. "PLEASE"
My only Idea is through the ID,but I do not know how.
OR somehow give each one a different Reference name instead of txt=wx.StaticText, but i need to create them
within:
for x in range(y):
thanks
matthias janes