Python Forum

Full Version: Tkinter - How can I extend a label widget?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
maybe it's a simple question, but I can't find a solition.

below an image. by default a label widget has 3 blank pixels placed on each side for the padding. my question is, how can I extend this padding just on the right size?

[Image: 6e2c8a1355825089.jpg]

keep in mind that the label can change its context (just the text), so this padding, for example 5 pixel, must be the same for each kind of label.
you can use a tuple as shown here :
padding one side
Try using padx, pady options when creating a label:
label = tk.Label(canvas,text="text here",padx = 10 , pady = 10 )