diff --git a/journal.py b/journal.py index 44b8485..f6113b8 100755 --- a/journal.py +++ b/journal.py @@ -70,9 +70,16 @@ name_entry.focus() # # textbox +# TODO: textbox need a scrollbar when applicable +# standard height of the textbox is 40 unless the screen provides more space in which case we will compute +# the textbox_heigth reasonably and relatively to the screensize +textbox_height: int = 40 +if height > 1080: + textbox_height = height - 1400 + message_label = tk.Label(journal, text = "Deine Nachricht:") message_label.grid(column = 0, row = 1, sticky = 'w', padx = 5) -message_text = tk.Text(journal, height = height-1400) +message_text = tk.Text(journal, height = textbox_height) message_text.grid(column = 0, row = 2, padx = 5) def send_button_clicked(): @@ -86,6 +93,7 @@ def send_button_clicked(): def save_and_quit_button_clicked(): with open(journal_filename_path, "a") as journal_of_the_day: + journal_of_the_day.write("Speichern und Beenden von: " + name.get() + " um " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + "\n") 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")