def init(): """Initializes the magnifier, bringing the magnifier up on the display. Returns True if the initialization procedure was run or False if this module has already been initialized. """ global _initialized global _magnifier if not _magnifierAvailable: return False if _initialized: return False _magnifier = bonobo.get_object("OAFIID:GNOME_Magnifier_Magnifier:0.9", "GNOME/Magnifier/Magnifier") try: applySettings() atspi.Registry().registerEventListener(__onMouseEvent, "mouse:abs") _initialized = True # Zoom to the upper left corner of the display for now. # __setROICenter(0, 0) return True except: _magnifier.dispose() raise
def monitor_activation(self): es = bonobo.get_object(IID_ACTIVATION, IDL_EVENTSOURCE) bonobo.event_source_client_add_listener(es, self.on_register, EVT_REG) bonobo.event_source_client_add_listener(es, self.on_unregister, EVT_UNREG) print "Watching application activations"
import bonobo import Bonobo bonobo.activate () obj = bonobo.get_object ('OAFIID:Bonobo_Sample_Echo', 'Bonobo/Sample/Echo') obj.echo ('This is the message from the python client\n')