pythontkinterwidgetwidthtkinter-entry

How do I set the width of an Tkinter Entry widget in pixels?


I noticed that the width argument for the Tkinter entry widget is in characters, not pixels.

Is it possible to adjust the width in pixels?


Solution

  • You cannot specify the width in pixels using the '-width' option, but there are ways to accomplish the same thing. For example, you could pack an entry in a frame that has no border, turn off geometry propagation on the frame, then set the width of the frame in pixels.