I have following set of TextCtrl which I edit when needed.
import wx
class MyCheckBox(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Values', size=(490, 450))
panel = wx.Panel(self, -1)
List = [(70, 55), (170, 55), (270, 55), (370, 55),
(70, 85), (170, 85), (270, 85), (370, 85)]
val = []
for i in range(0,8):
value = -999
val.append(value)
for p,v in zip(List,val):
self.value = wx.TextCtrl(panel, -1, value=str(v), pos=p, size=(60,25))
self.btnOK = wx.Button(panel, label="OK", pos=(190, 355))
self.Bind(wx.EVT_BUTTON, self.OnOK, id = self.btnOK.GetId())
def OnOK(self, event):
self.Show(False)
Currently, default value for all of them is '-999'. How can I retrieve them to a list at the end of process when I press OK?
You need to keep your textcontrols inside a list in order to recover their values afterwards: