Added event handling to menu items in text editor