Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need to make two identical Entries in a same row, but each Entry's text have a different font. I tried setting a fixed width to both entries, but the Font modifies it. Is there any way to set a fixed size to an Entry regardless its size?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
250 views
Welcome To Ask or Share your Answers For Others

1 Answer

Don't set the Entry size, set the size of whatever container they are in. As you say "row" I assume you are using a grid layout. This would be a good place to use the completely undocumented "uniform" argument.

frame.columnconfigure([0,1], uniform='entrycol') # set columns 0 and 1 to the same width

ent = tk.Entry(frame, width=2) # set the width small to start
ent.grid(row=0, column=0, sticky='ew') # set the entry to stick to the east and west

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...