mit lambda im button command wird die funktion erst bei klick ausgeführt
This commit is contained in:
parent
a2cb24c6ee
commit
4266bc27ab
|
|
@ -49,9 +49,9 @@ message_text.pack()
|
|||
|
||||
def send_button_clicked(name, message):
|
||||
with open(journal_filename_path, "a") as journal_of_the_day:
|
||||
journal_of_the_day.write(name.get())
|
||||
journal_of_the_day.write(message.get())
|
||||
journal_of_the_day.write("-----------------")
|
||||
journal_of_the_day.write(name.get() + "\n")
|
||||
journal_of_the_day.write(message.get() + "\n")
|
||||
journal_of_the_day.write("-----------------\n")
|
||||
showinfo(title="Information", message="Deine Nachricht wurde gespeichert")
|
||||
|
||||
# Send Button
|
||||
|
|
@ -59,7 +59,7 @@ button_send = ttk.Button(
|
|||
journal,
|
||||
text="Abschicken",
|
||||
#command=lambda: showinfo(title="Information", message="Deine Nachricht wurde gespeichert")
|
||||
command=send_button_clicked(name, message)
|
||||
command=lambda: send_button_clicked(name, message)
|
||||
)
|
||||
button_send.pack()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user