简体   繁体   中英

python ttk.Entry how to center the input

我的应用的截图

Here is a screenshot of a program I am writing using Python Tkinter. I use ttk.Entry widget to get the user input.

I would like to know how to center the input in the Entry (as you can see, the input is now stuck to the left part of the widget)

Entry widgets take the option justify , which for centered text should be 'center' . When creating the widget, do something like

e = ttk.Entry(master, ..., justify='center')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM