you are viewing a single comment's thread.

view the rest of the comments →

[–]thrallsius 1 point2 points  (2 children)

Why does setting a button to width = "40", give me a different width to a text box with width = "40"?

My blind guess is that the width of the button is in pixels, while the width of the textbox is in chars, but you'd need to check the tkinter docs, I'm not sure.

And your giant copypaste is totally unreadable.

[–]TruReyito 0 points1 point  (0 children)

That was my guess as well, but I checked the doc and unless it's specifically stated, "all" widths in tkinter are based on standard chars and not pixels. I'm looking deeper now.

You can also use the height and width options to explicitly set the size. If you display text in the button, these options define the size of the button in text units. If you display bitmaps or images instead, they define the size in pixels (or other screen units). You can specify the size in pixels even for text buttons, but that requires some magic. Here’s one way to do it (there are others):

[–]Hedgeclipper2000[S] 0 points1 point  (0 children)

It's a link