How can I go to the clickbox event on the listbox with a parameter?
listabook.bind('<Button-1>',Delete(labelvoto))
def Delete(label):
label.destroy()
How can I go to the clickbox event on the listbox with a parameter?
listabook.bind('<Button-1>',Delete(labelvoto))
def Delete(label):
label.destroy()
You may have to use lambda
here. When you are creating your listabook bind then
If you have something that is going to call the function before it has been initialized then you need to make sure your function precedes that call in the code.
There is some good information on lambda
here.
The below should work.
def Delete(label):
label.destroy()
listabook.bind('<Button-1>',lambda _: Delete(labelvoto))