Is it possible do make a Text widget in Tkinter non-clickable and non-editable?
Just set its state to "disabled":
from Tkinter import Tk, Text, DISABLED
r = Tk()
Text(r, state=DISABLED).grid()
r.mainloop()
You can even enter some text before you disable it.
from Tkinter import Tk, Text, DISABLED
r = Tk()
t = Text(r)
t.grid()
t.insert(0.0, "BLAH!")
# Just make sure you disable it AFTER you put the text in
t["state"] = DISABLED
r.mainloop()
Then I suppose you could set its background to be grey or something so that people know it is inactive.
Edit:
Since you asked, you can reactivate the textbox like this:
# Note you have to have NORMAL imported
t["state"] = NORMAL
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