May-14-2019, 03:04 PM
(May-11-2019, 08:05 AM)Yoriz Wrote: It is still unclear if the text editor is an independent application or one thats created by using one of the GUI frameworks.
If its a GUI framework the text editor will most likely have a undo/redo methods.
If its an independent application you can use a GUI automator like PyAutoGUI
I'm new to Python, so let me try explain as best as I can.
I'm using a text editor called Pluma.
Pluma was coded in C (which I'm also unfamiliar with.) However, python plugins have been created that have been added to the Pluma text editor. Within one of the plugins I'm editing, I'm trying to add Undo and Redo functions to the context menu (pops-up on right-click). I've added the labels, but the only thing I can do is select them to print an output statement to screen.
Now, the python plugin I'm working with uses GTK. I can add items to the UI manager using Gtk.Action.add_action, etc. within the python plugin code. Now these items like Undo, Cut,Paste with the UI Menu manager, execute upon selection with a mouse click within the Edit drop-down menu. I want to add Undo and Redo functions to the context menu. Each time I select the Undo or Redo items from the context menu, I want it to execute the same way as if I selected the same Undo or Redo items from the drop-down Edit menu.
I hope this clarifies things.
s.