Tkinter text widget

goldtech goldtech at worldpost.com
Sun Oct 7 05:18:02 CEST 2007


I thought the "DISABLED" made it so I could not edit it. But it also
makes it so I can not scroll down. If you make the window smaller than
the content then try to put a cursor in there to use up/down arrow you
can't.

What I want is not to be able to change text content, but no other
action is disabled. Is this complicated to do?

Thanks.


from Tkinter import *
root = Tk()
text = Text(root, font=("Courier"))
text.pack()
i='123456789abcdefghijklmnopqrstuvwxyz\n'
for x in range(30):
    text.insert(END, i)
text.config(state=DISABLED)
mainloop()




More information about the Python-list mailing list