Hi, sorry again a newbie question,
I like to allocate a lot of wx Gui elements and refer to them
dynamically( and be able to refer to them individually on event).
What I am doing now is really horrible:
Firstly I need a of lines like this:
ID_SpinCtrl01, ID_SpinCtrl02,ID_SpinCtrl03 =wx.NewId(),
wx.NewId(),wx.NewId()
ID_SpinCtrl04, ID_SpinCtrl05,ID_SpinCtrl06 =wx.NewId(),
wx.NewId(),wx.NewId()
ID_SpinCtrl07, ID_SpinCtrl08,ID_SpinCtrl09 =wx.NewId(),
wx.NewId(),wx.NewId()
And then I need a lot of lines like this:
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl01)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl02)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl03)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl04)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl05)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl06)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl07)
self.Bind(wx.EVT_SPINCTRL, self.onSpinCtrl, id=ID_SpinCtrl08)
Which is even worse. Obviously I tried to use RANGE but it didn't work
(syntax error).
How can I do something like this: SEMI CODE DOESN"T WORK
for x in range(0,10):
counter = str(x)
ID_SpinCtrl+str(x)= wx.NewID()