I want to update the cspray
window with new radio buttons . But now the buttons gets overrited everytime the clicked_value
function is called.
def clicked_value(self):
if clicked.get()!="":
for row in tree_caster_data.get_children():
tree_caster_data.delete(row)
cspray.update()
#make tab from section ID
tab_names = []
for item in tree_caster_data.get_children():
tab_names.append(tree_caster_data.item(item)['values'][0])
var = StringVar()
var.set(tab_names[0])
radio_frame = Frame(cspray).grid(row=0, column=0)
i=0
for item in tab_names:
button = Radiobutton(radio_frame, text=item, variable=var, value=item, command=lambda: sel())
button.grid(row=0,column=i)
i+=1
I have tried updating the window but it does not work. The main problem is that theradio buttons are created using the obtained list and the list values are to be generated inside the same function so I cannottake the radio button outside in order to use destroy function at the start of the function. Please help me in this. Thankyou so much in advance.