Is there any way to make the tkinter label widget
vertical? Something like this
or is it just simply impossible? I have already look around and can't seems to find how to do it.By the way, i have tried orient='vertical'
but label widget
doesn't seems to support it.
We can use place() method to set the position of the Tkinter labels.
Tkinter Label widget can be aligned using the anchor attributes. In order to calculate the accommodate spacing and alignment of the widget, anchor would help in a better way. Anchor provides several options such as N, W, S, E, NW, NE. SW, SE which can be defined in the pack manager itself.
To configure and align the text at the CENTER of a Tkinter Text widget, we can use justify=CENTER property.
relx, rely − Horizontal and vertical offset as a float between 0.0 and 1.0, as a fraction of the height and width of the parent widget. x, y − Horizontal and vertical offset in pixels.
You can achieve vertical display, without the text rotation, by using the wraplength option which set to 1 will force the next char into a new line:
Label( master_frame, text="Vertical Label", wraplength=1 ).grid( row=0, column=0 )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With