From 28c379f5f4cd64618c86d4d513e4bb6f9ebbb3a7 Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 24 Mar 2024 10:46:35 +0100 Subject: [PATCH] computing of height of textbox relative to screenheight of monitor --- journal.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/journal.py b/journal.py index 8d2326a..44b8485 100755 --- a/journal.py +++ b/journal.py @@ -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(