Have you tried just disabling the text widget?
text_widget.configure(state="disabled")
On some platforms, you also need to add a binding on <1> to highlight the focus for the widget, otherwise the highlight for the copy will not appear:
text_widget.bind("<1>", lambda event: text_widget.focus_set())
If you disable the widget to insert programmatically, you just need to
- Change the state of the widget to
NORMAL - Paste the text and then
- Change state to
DISABLED
Until you call update in the middle, then there is no way for the user to contribute anything interactively.
Bryan oakley
source share