Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python tkinter label orientation

Is there any way to make the tkinter label widget vertical? Something like this

sample label

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.

like image 846
Chris Aung Avatar asked Jul 15 '13 08:07

Chris Aung


People also ask

How do I change the position of a label in Python?

We can use place() method to set the position of the Tkinter labels.

How do you align labels in python?

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.

How do you center text in python tkinter?

To configure and align the text at the CENTER of a Tkinter Text widget, we can use justify=CENTER property.

What is RELX and rely in tkinter?

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.


1 Answers

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 )
like image 113
Omar Marquez Avatar answered Sep 19 '22 12:09

Omar Marquez