I'm writing an extension that shows two items on a popup ("Hello" and "Goodbye").
What I want to do is, when the user click one of these items, insert the respective text.
For example: I'm on gedit and I want to insert "Hello". So I open the extension and then I click "Hello" and it appears on gedit.
Here's the current code:
this._menucontent = null;
this._mymenu = new PopupMenu.PopupMenuItem(this._menucontent, { reactive: true });
item = new PopupMenu.PopupMenuItem(_("Hello"));
this.menu.addMenuItem(item);
item = new PopupMenu.PopupMenuItem(_("Goodbye"));
this.menu.addMenuItem(item);
Could anybody help me?