Home > Back-end >  Window size and position in inch or points
Window size and position in inch or points

Time:02-27

I was able to enter image description here

import tkinter as tk

root = tk.Tk()

x = int(root.winfo_fpixels('200p'))
y = int(root.winfo_fpixels('100p'))
w = int(root.winfo_fpixels('400p'))
h = int(root.winfo_fpixels('200p'))

root.geometry(f"{x}x{y} {w} {h}")
root.title('root')

other = tk.Toplevel()
other.geometry(f"200x100 400 200")
other.title('other')

root.mainloop()
  • Related