Kann mir bitte jemand sagen warum as nicht funktioniert und ich den eingegebenene text nicht zurück bekomme.
class eigene_dialoge:
def notiz_dialog(title):
notiz = "inhalt"#o(title,"r")
w_editnotiz = tk.Tk()
def cancel():
w_editnotiz.destroy
def ok():
w_editnotiz.destroy
l_wttitle = tk.Label(w_editnotiz, text="Titel:")
l_wtitle = tk.Entry(w_editnotiz)
l_wtitle.insert(0,title)
l_wtinhalt = tk.Label(w_editnotiz, text="Inhalt:")
l_winhalt = tk.Entry(w_editnotiz)
l_winhalt.insert(0,notiz.read())
l_button_save = tk.Button(w_editnotiz, text="Save" ,command=ok)
l_button_cancel = tk.Button(w_editnotiz, text="Abbrechen" ,command=cancel)
l_wttitle.pack()
l_wtitle.pack()
l_wtinhalt.pack()
l_winhalt.pack()
l_button_save.pack()
l_button_cancel.pack()
l_button_save.pack(fill="x")
l_button_cancel.pack(fill="x")
w_editnotiz.mainloop()
return [l_wtitle.get(),l_winhalt.get()]
print(eigene_dialoge.notiz_dialog("test"))