'Bad idea to define window and widget size in pixels?
Is it a bad idea to define window and widget sizes in pixels, if I want to keep a GUI in a good shape on any screen? Is text always displayed with the same pixel size, and does the text in the following example fit the white box on any screen? Is there an option in tkinter to use points instead of pixels?
import tkinter as tk
root = tk.Tk()
root.geometry("200x100+400+200")
root.configure(background='black')
lbl = tk.Label(text="This is a test.", bg='white')
lbl.place(x=20, y=20, width=68, height=11)
root.mainloop()
Solution 1:[1]
That is a bad idea, yes. Define the relationships you want and tkinter figure out the pixel locations.
If I run your code on my computer I get this:
(probably because I have a different default font then you do)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Novel |


