Re: Reg. modifying GTK+ to add menu option



On 2013-04-10 19:52, Sindhu S wrote:
I want to add this to GTK+ because it will automatically benefit
every GNOME Application, and have consistency for the user.

Hi Sindhu,

Just some thoughts:

* It might be possible to do this as a GNOME Shell extension, where I
can imagine pressing some keyboard combination or whatever to activate
the query. Then, by using the accessibility framework a look-up
would not be limited to applications using GTK+ but you'd get support
for LibreOffice, Firefox, QT and anything else talking AT-SPI basically
for free.

As an example, attached is a standalone (very incomplete and not very
well tested) Python script using Atspi, Wnck and Gdk via gobject-introspection
(originally based on code from Accerciser) that retrieves the word
under the mouse pointer (if any) using AT-SPI.

To test the script:
- open a terminal,
- type "get_text_under_pointer.py"
- put the mouse pointer somewhere, for example point at a word in a
GEdit or LibreOffice Writer document or web page in Firefox or Epiphany etc
- your terminal still having focus, hit enter

* Maybe a "translate" option in addition to "look up in dictionary"
might be useful for some people too?

mvg,
Dieter

Attachment: get_text_under_pointer.py
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]