I tried
textEntry = Entry(root, width=115, textvariable=text, height=12)
but I got an error invloving the height.
Then I tried using the Text widget:
textEntry = Text(root, width=115, textvariable=text, height=12)
but I got an error involving textvariable=text
Any way I could adjust the height of the Entry or the variable of the Text?
To change an entry widget's size you have to change its font to a larger one.
For example:
import tkinter as tk
large_font = ('Verdana',30)
small_font = ('Verdana',10)
root = tk.Tk()
entry1Var = tk.StringVar(value='Large Font!')
entry1 = tk.Entry(root,textvariable=entry1Var,font=large_font)
entry1.pack()
entry2Var = tk.StringVar(value='Small Font!')
entry2 = tk.Entry(root,textvariable=entry2Var,font=small_font)
entry2.pack()
root.mainloop()
No, there is no way to set the height of an Entry widget,and no, there is no way to use a variable with the text widget.
If you need a widget that allows you to enter more than one line of text your only option is a Text widget, and there's simply no reason to associate a variable with the widget because a text widget can contain more than just characters (images, embedded widgets, styling information)
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