position stuff cia .grid() instead of .pack()

This commit is contained in:
julian 2024-03-23 16:07:10 +01:00
parent 5ffc4e647b
commit 6d878b3761

View File

@ -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()