Search code examples
pythontexttkinter

Is there a way to make the Tkinter text widget read only?


It doesn't look like it has that attribute, but it'd be really useful to me.


Solution

  • You have to change the state of the Text widget from NORMAL to DISABLED after entering text.insert() or text.bind() :

    text.config(state=DISABLED)