From 6d878b3761e8cf04c7dbd3633476a608d9f206f3 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 23 Mar 2024 16:07:10 +0100 Subject: [PATCH] position stuff cia .grid() instead of .pack() --- journal.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/journal.py b/journal.py index 3574932..faf8b0a 100755 --- a/journal.py +++ b/journal.py @@ -55,22 +55,22 @@ message = tk.StringVar() # # Main Window journal = ttk.Frame(journal) -journal.pack() +journal.pack(pady=100, side=tk.TOP) # # name name_label = ttk.Label(journal, text = "Dein Name:") -name_label.pack(fill = 'x', expand = True) +name_label.grid(sticky = 'w', column = 0, row = 0) name_entry = ttk.Entry(journal, textvariable = name) -name_entry.pack(fill = 'x', expand = True) +name_entry.grid(sticky = 'n', column = 0, row = 0, rowspan = True) name_entry.focus() # # textbox message_label = tk.Label(journal, text = "Deine Nachricht:") -message_label.pack(fill = 'x', expand = True) +message_label.grid(column = 0, row = 1, rowspan = True) message_text = tk.Text(journal, height = 50) -message_text.pack() +message_text.grid(column = 0, row = 2) def send_button_clicked(): @@ -96,7 +96,8 @@ button_send = ttk.Button( text = "Abschicken", command = lambda: send_button_clicked() ) -button_send.pack(pady = 15, padx = 15) +button_send.grid(sticky = 'n', column = 0, row = 3) + # # Quit Button @@ -105,6 +106,6 @@ button_quit = ttk.Button( text = "Speichern und Beenden", command = lambda: save_and_quit_button_clicked() ) -button_quit.pack() +button_quit.grid(sticky = 'n', column = 0, row = 4) journal.mainloop()