I am struggling to align some widgets in my tkinter project. I want the label at the top of the window to be center aligned and the combobox to be under that label and right aligned.
I've been trying for a little while, but still can't get it working. I would really appreciate pointers from anyone who can tell where I've gone wrong. I've attached my code and a screenshot to better illustrate the issue.
import sqlite3
import tkinter as tk
from tkinter import ttk
from ctypes import windll
windll.shcore.SetProcessDpiAwareness(1)
root = tk.Tk()
root.title("Solve Times Tracker")
root.configure(background="gray")
root.geometry("1200x800")
tk.Label(root, text="Solving time logger", font='ariel 17', anchor="w").grid(row=0,column=0,sticky="N")
options = ["one","two","three"]
combotext = tk.StringVar()
combotext.set('Please select your name')
select = ttk.Combobox(root, textvariable=combotext, state="readonly", font='ariel 17', width=25)
select.grid(row=1,column=1,sticky="E", pady=20)
select['values'] = ("one","two","three")
def callback_function(event):
print('You selected:', combotext.get())
root.bind('<<ComboboxSelected>>', callback_function)
root.mainloop()
Thanks.