Pergunta

I use a messagebox as a widget to display results from a random number generator. The number of random numbers is chosen through an entry box. Using

def evClear():
    from_draws.delete(0,END)# clears only entry value
    from_draws.focus()
    cvt_to.delete()

I succesfuklly delete the contents of the entry box (from_draws), however the cvt_to which contains the random numbers gives an error: AttributeError: 'StringVar' object has no attribute 'delete' How can one delete both ( simply to make the GUI look a bit better)? If one places a different number in the entry box, the reruslt is ovwerwritten by the new result. I guess the question is how to delete the contents written to a messagebox, please

Foi útil?

Solução

replace

cvt_to.delete()

by

cvt_to.set("")  # set to empty string
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top