[Tutor] Clear the text in an entry widget

David Holland davholla2002 at yahoo.co.uk
Sun Mar 13 19:15:56 CET 2005


I have written a simple test your maths program.
There is just one question, how do you clear the text
in a tkinter widget ?
The only way that I could do it was to create a
function to create the entry widget and then have it
re-created.  Is there a better way.
This is the way I did :-


    def create_entry(self):
        #self.label2_lbl.grid(row = 10, column = 0,
columnspan = 2, sticky = W)
        self.answer_ent = Entry(self, width = 20)
        self.answer_ent.grid(row = 10, column = 2,
columnspan = 4)
        self.answer_txt = Text(self, width = 80,
height = 5)
        self.answer_txt.grid(row = 14, column = 2,
columnspan = 4)

When the user asks for another a question and when the
program is initiated this is called.
        

Send instant messages to your online friends http://uk.messenger.yahoo.com 


More information about the Tutor mailing list