computing of height of textbox relative to screenheight of monitor

This commit is contained in:
julian 2024-03-24 10:46:35 +01:00
parent 27fee4c58d
commit 28c379f5f4

View File

@ -29,6 +29,7 @@ else:
pass
journal = tk.Tk()
journal.attributes('-alpha', 0.5)
#
# set window to fullscreen (dependend of the actual screensize) and fill with a background image
@ -40,9 +41,11 @@ journal.title("Ameland Kinderjournal")
img = ImageTk.PhotoImage(Image.open(image_location).resize((width, height), Image.ADAPTIVE))
label = tk.Label(journal, image=img)
#
# Keep a reference in case this code put is in a function.
# Keep a reference in case this code is put in a function.
label.img = img
#
# Place label in center of parent.
label.place(relx=0.5, rely=0.5, anchor='center')
@ -69,10 +72,9 @@ name_entry.focus()
# textbox
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 = 50)
message_text = tk.Text(journal, height = height-1400)
message_text.grid(column = 0, row = 2, padx = 5)
def send_button_clicked():
with open(journal_filename_path, "a") as journal_of_the_day:
journal_of_the_day.write("Eintrag von: " + name.get() + " um " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + "\n")
@ -98,7 +100,6 @@ button_send = ttk.Button(
)
button_send.grid(sticky = 'w', column = 0, row = 3, ipady = 8, padx = 5, pady = 5)
#
# Quit Button
button_quit = ttk.Button(