#๐Ÿ”’ tkinter grid weirdly offset

7 messages ยท Page 1 of 1 (latest)

marble mountain
#

import customtkinter as tk

root = tk.CTk()

WIDTH, HEIGHT = 400, 500
root.geometry(f"{WIDTH}x{HEIGHT}")

frame = tk.CTkScrollableFrame(root, width=WIDTH, height=HEIGHT)
frame.pack()

frame.grid_anchor("center")

tk.CTkLabel(frame, text="Starting School Time:").grid(row=1, column=1)
starting_school_time = tk.CTkEntry(frame, width=70, height=14)
starting_school_time.grid(row=1, column=2)

tk.CTkLabel(frame, text="Ending School Time:").grid(rows=2, column=1)
ending_school_time = tk.CTkEntry(frame, width=70, height=14)
ending_school_time.grid(rows=2, column=2)

root.mainloop()```
tepid pelicanBOT
#

@marble mountain

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

marble mountain
#

I want the second textbox to be in line with "Ending School Time:"

junior quest
#

Maybe rows = 2 should be row = 2 in the next to last line.

tepid pelicanBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.