0

hi I have a problem with Tkinter widget I try to center the widgets in the center of the screen but I could not successfully help anyone?

open_windows.geometry("300x600")
Label(open_windows, image=bgImage).place(relwidth=1, relheight=1)
center_frame = Frame(open_windows, padx=10, pady=10)
login_label = Label(open_windows, text="login to your instagram user")
username_label = Label(open_windows, text="User Name:")
password_label = Label(open_windows, text="Password:")
username_entry = Entry(open_windows, width=25)
password_entry = Entry(open_windows, width=25)
submit_button = Button(open_windows, text="submit")

username_label.grid(row=0, column=0, padx=10, pady=10, sticky="NSEW")
username_entry.grid(row=0, column=1, padx=10, pady=10, sticky="NSEW")
password_label.grid(row=1, column=0, padx=10, pady=10, sticky="NSEW")
password_entry.grid(row=1, column=1, padx=10, pady=10, sticky="NSEW")
submit_button.grid(row=2, column=0, columnspan=2, padx=10, pady=10, sticky="NSEW")
open_windows.mainloop()
ordahan1
  • 19
  • 3
  • 1
    The GRID Manager centers by default, i assume you want to center `open_windows`? Does this answer your question? [how-to-center-a-window-on-the-screen-in-tkinter](https://stackoverflow.com/questions/3352918) – stovfl May 09 '20 at 20:02
  • 1
    `open_windows.geometry("300x600+810+240")` for 1k screens – rizerphe May 10 '20 at 03:49
  • @stovfi I am not sure you understand me I put some image in the link that you can look I try put username and password label and entry in the center of my "open_windows" [link]: https://ibb.co/Fx2V61C – ordahan1 May 10 '20 at 20:05

0 Answers0