speichern des Textes auch beim Beenden
This commit is contained in:
parent
97daa96466
commit
d315ddc8e9
|
|
@ -58,6 +58,11 @@ def send_button_clicked():
|
||||||
journal_of_the_day.write("-----------------\n")
|
journal_of_the_day.write("-----------------\n")
|
||||||
showinfo(title = "Information", message = "Deine Nachricht wurde gespeichert")
|
showinfo(title = "Information", message = "Deine Nachricht wurde gespeichert")
|
||||||
|
|
||||||
|
def save_and_quit_button_clicked():
|
||||||
|
with open(journal_filename_path, "a") as journal_of_the_day:
|
||||||
|
journal_of_the_day.write(name.get() + "\n")
|
||||||
|
journal_of_the_day.write(message_text.get(1.0, "end-1c") + "\n")
|
||||||
|
journal_of_the_day.write("-----------------\n")
|
||||||
|
|
||||||
# Send Button
|
# Send Button
|
||||||
button_send = ttk.Button(
|
button_send = ttk.Button(
|
||||||
|
|
@ -72,8 +77,10 @@ button_send.pack()
|
||||||
button_quit = ttk.Button(
|
button_quit = ttk.Button(
|
||||||
journal,
|
journal,
|
||||||
text = "Speichern und Beenden",
|
text = "Speichern und Beenden",
|
||||||
command = lambda: journal.quit()
|
#command = lambda: journal.quit()
|
||||||
|
command = lambda: save_and_quit_button_clicked()
|
||||||
)
|
)
|
||||||
|
|
||||||
button_quit.pack()
|
button_quit.pack()
|
||||||
|
|
||||||
journal.mainloop()
|
journal.mainloop()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user