I want to create an interactive text box in a tkinter GUI, the text box should get the text to wrap to the next line after the length of 30 characters, like it would do using the wraplength=30 attribute in a label widget. I am trying to get it to work using an Entry widget, this is what I am aiming for (apart from the wraplength attribute needs to be changed to something that works in an Entry widget:
ent = Entry(root, width=30, wraplength=30)
I also need to be able to make the Entry widget taller than one line, is there a way i can do that, for example making it vertically fill a frame (similarly to expand=True making it horizontally fill a frame).
Thank you!
The entry widget doesn't support wrapping. If you want to have multiple lines -- even if it's one long line that's wrapped -- you'll need to use either a Text, Label, or Message widget. Only the Text widget supports user input, the other two are strictly for display.
As for making the entry widget taller, you can do that with a geometry manager. For example, you can use the sticky option of grid or the fill and expand options of pack. This will make the widget taller, but the text will still just appear as a single line.
wrap text in an entry widget in tkinter