Hi Francisco,

Few days ago generic mechanism was implemented for callback handlers creation, see function createCallback() in VirtualBoxManager.
One can use it like this:

class MyCallback
   def onMachineStateChange (self, ...):
      ....
  # implement all  methods of IVirtualBoxCallback here

cb = mgr.createCallback('IVirtualBoxCallback', MyCallback)
mgr.vbox.registerCallback(cb)

This approach shall work for both XPCOM and MS COM targets.

 Thanks,
   Nikolay

Francisco J. Vázquez пишет:
Hi,

I'm finishing the migration of my program from ugly hacks to the
python api provided by virtualbox. The only thing left is being able
to register callbacks. I assume I have to create an object
implementing the VirtualBoxCallback interface, assign a function to
the onMachineStateChange (or wathever event I want to monitor)
variable and pass that object to registerCallback. Is this possible to
do this in python? If so, how can it be done?

Thanks


_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to