python 3.x - clearing entry text with tkinter -


so i'm having trouble deleting text entered user help? of code...

menubar = menu(mgui)   filemenu = menu(menubar, tearoff = 0) filemenu.add_command(label="new", command = mnew) filemenu.add_command(label="open", command = mopen) filemenu.add_command(label="close", command = mquit) menubar.add_cascade(label = "file", menu=filemenu)  #edit bar condtruction editmenu = menu(menubar, tearoff = 0) editmenu.add_command(label="clear text", command = mclear) menubar.add_cascade(label = "edit", menu=editmenu) 

here things explaining mquit , stuff

def mhello():     mtext = ment.get()     mlabel2 = label(mgui, text = mtext).pack()     return def mnew():     filemenu.add_command(label="new")     menubar.add_cascade(label="file", menu=filemenu)     return def mclear():     delete(first, last=none) 

plz me clear text, thanks!

assuming ment refers tkinter entry widget, use `ment.delete(0,"end").


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -