I'm trying to write in a text window with word wrapping disabled & horizontal scrollbar, like this:
root = Toplevel()
root.geometry("%dx%d+0+0" % (350,400))
af=Frame(root)
chtext = Text(af, width=45, wrap=None,font=("Arial",12))
chxscrollbar=Scrollbar(chtext, orient=HORIZONTAL, command=chtext.xview)
chtext["xscrollcommand"]=chxscrollbar.set
af.pack(fill="both", expand=True)
chtext.pack(side="left", expand=1, fill="both")
chxscrollbar.pack(side="bottom", fill="x", expand=False)
my problem is that it still wordwraps what I write into it... am I missing something obvious???
thanks!
None is not a valid value for the wrap option. You need to use the string "none" or the tkinter variable NONE. By specifying the python value None you are actually requesting the default value, which is "char"
chtext = Text(af, width=45, wrap="none", font=("Arial",12))
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