Two doubts about Kinter

Asked

Viewed 45 times

0

I have two questions about GUI Tkinter. The first is: how do I stop when the text of a label is larger than the label size, the text instead of being missing, continue on the next line. The second would be how to make texts of a label that have " n" aligned to the left, I can only make the first item stay, the rest stay centered

2 answers

0

To increase the font of any widget just import the Tkinter.font module then instantiate the Font class with the keywordargument size=20 , then simply put the Font instance in any widget in the font option. take the example:

import tkinter
import tkinter.font
root=tkinter.App()
fonte=tkinter.font.Font(size=20)

butao=tkinter.Button(root,text=ok, font=fonte)
butao.pack()

root.mainloop()

0


User "Message" instead of Label that the two problems will be solved at once.

texto = Message(root, text="Bom dia!")
texto.pack()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.