View Single Post
Old 03-27-2015, 12:37 PM   #1
jverrone3
Junior Member
jverrone3 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2015
Device: none
[Viewer Plugin] Get selected text on right click.

The Calibre ebook viewer has some functionality built into it that I would like to implement with a plugin.

The goal is to have something similar to the "Search Google for [selected text]" when you right click. Instead of the action opening an internet browser, I would like to create a modal pop up that contains more information based on the given text.

Ideally I would also like to create a button in the toolbar that would hold the same functionality.

I see the customize_ui(ui) and customize_context_menu(menu, event, hit_test_result) methods in the ViewerPlugin, but I am stuck on how to actually get the selected text from these parameters and connect a click event to these items.
jverrone3 is offline   Reply With Quote