Pregunta

Tengo que hacer tanto un Control-Z y la función Shift-Control-Z en Python. Alguien tiene alguna idea?

También necesito para seleccionar el contenido de un widget de texto entero, Alguien sabe cómo hacer eso?

¿Fue útil?

Solución

Para que el mecanismo de deshacer, comprobar el UndoDelegator.py de Idle en combinación con EditorWindow.py.

Para seleccionar todo el contenido de un widget de texto, que puede hacer:

# remove previous selection, if any
text_widget.tag_remove(Tkinter.SEL, "1.0", Tkinter.END)
# select all
text_widget.tag_add(Tkinter.SEL, "1.0", Tkinter.END)
# place cursor
text_widget.mark_set(Tkinter.INSERT, Tkinter.END)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top