For folks following in my footsteps, I've unearthed a few references that
describe how to use Python to talk to the Accessibility interfaces.  (But read
on for a question on marshalling callbacks.)  I'm on travel this week and have
had only occasional net access, so I've had to make do with the docs already
available on my hard drive.  Luckily Debian installs a lot of them by default.

The IDL files (/usr/share/idl/at-spi-1.0 on my Debian system) list what methods
can be called on what objects.  Read them in conjunction with the "Python
language binding" from the OMG.

The AT-SPI C Bindings Reference Manual
(/usr/share/doc/at-spi-doc/html/at-spi-cspi/book1.html) has a bit more
documentation on the functions listed in the IDL files.

The "Bonobo Activation API Reference Manual"
(/usr/share/gtk-doc/html/bonobo-activation/api-reference.html) tells you how to
get started, that is, how to construct a Python object that is connected to a
CORBA object in the Bonobo framework.  This includes querying the bonobo
activation server for a particular interface, using the "repo_ids" magic that
James posted before.

Based on those references, I've managed to dump the contents of all current
a11y-enabled windows.  My next challenge is how to register a listener on
change events.  Based on an example in the OMG document, I tried this:

class MyListener(Accessibility__POA.EventListener):
    def notifyEvent(self, event):
        print 'Event notified:', event

registry = bonobo.activation.activate(
    "repo_ids.has('IDL:Accessibility/Registry:1.0')")
listener = MyListener()
registry.registerGlobalEventListener(listener, 'focus:')

However this gives me an error (TypeError: could not marshal arg 'listener').
I also tried without the __POA in the EventListener interface name, and got a
different error (NotImplementedError: can not construct objecre [sic]
references).  What am I doing wrong?

Thanks,
--Tessa

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to