0

I'm trying to delete the text from an entry widget but it's doesn't work...

How can i fix it please? I separated the frames:

frame0 --> label and entry

frame1 --> buttons

it's somehow impact on that ? Thanks in advance, eliran.

import tkinter
import tkinter.ttk


def custom_link():
    
    window4 = tkinter.Toplevel()

    window4.geometry("650x100")   

    frame0 = tkinter.ttk.Frame(window4)
    frame0.grid(row=0, column=0)

    frame1 = tkinter.ttk.Frame(window4)
    frame1.grid(row=1, column=0)

    link_text_label =  tkinter.ttk.Label(frame0, text="Enter link: ")
    link_text_label.grid(row=0, column=0, sticky='w',padx=5)

    link_entry = tkinter.Entry(frame0, width=60, foreground="blue", font=("ariel",11))                 
    link_entry.grid(row=0, column=1, sticky='w', padx=1, pady=3 )

    save_link = tkinter.ttk.Button(frame1, text="Save", command=None)                                      
    save_link.grid(row=0, column=0, sticky='w', padx=5)

    clear_text_btn = tkinter.ttk.Button(frame1, text="Clear", command= link_entry.delete(0, 'end') )        
    clear_text_btn.grid(row=0, column=1, sticky='w', padx=5)


window = tkinter.Tk()

window.geometry("150x100")   

frame = tkinter.ttk.Frame(window)

frame.grid(row=0, column=0)

Btn = tkinter.ttk.Button(window, text="button", command = custom_link)

Btn.grid(row=0, column=0)


window.mainloop()
  • 1
    What does "doesn't work" mean? Does it do the wrong thing? The right thing at the wrong time? Throw an error? – Bryan Oakley Jul 03 '20 at 16:01
  • I don't know what you mean about ignoring the lambda. There is no use of lambda in your code. – Bryan Oakley Jul 03 '20 at 16:08
  • Sorry lol.. my mistake I read the message wrong, Thanks for the help ! I thought it's me that adding the lambda but actually is was the reply I got from Atlas435 user –  Jul 03 '20 at 16:14

0 Answers0