I want to be able to generate a certain number of text boxes depending on a number declared by another text box. In this case trav = 5, so I want to show 5 boxes
This is where I have got so far, where trav is the variable that I ultimately want to be a textbox variable.
self.text_box = {}
gp = GridPanel()
trav = 5
i = 1
i += i
while i >= trav:
self.text_box = TextBox(text=i,
font ="Consolas",
bold= True,
foreground="#FFF",
background="#999",
)
self.text_box[i].tag.name = i
self.text_box[i].role = "text"
gp.add_component(self.text_box[i], row=1, col_xs=3, width_xs=1)
self.add_component(gp)
At the moment I am getting a key error. I presume I need to do something with i, to increment the label name but I cant get it to work.
Thanks in advance