Keep selection in Tkinter login widgets despite lack of focus

When the user selects a portion of the text in the Tkinter input widget, it becomes highlighted. However, when the user clicks on the button, the widget disappears.

Is it possible to select the selected text even though the Entry widget has no focus?

I am trying to create a custom context menu that is not based on the Tkinter Menu widgets (based on the Tkinter Toplevel widget), and I would like the text to remain highlighted despite the focus of the menu.

+4
source share
1 answer

Do you want to set the exportselection option of the text widget to False

 text_widget.configure(exportselection=False) 
+5
source

All Articles