[vbox-dev] How to create an object implementing VirtualBoxCallback from python?
Nikolay.Igotti at Sun.COM
Sun Jun 14 09:40:12 PDT 2009
Few days ago generic mechanism was implemented for callback handlers
creation, see function createCallback() in VirtualBoxManager.
One can use it like this:
def onMachineStateChange (self, ...):
# implement all methods of IVirtualBoxCallback here
cb = mgr.createCallback('IVirtualBoxCallback', MyCallback)
This approach shall work for both XPCOM and MS COM targets.
Francisco J. Vázquez пишет:
> 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?
More information about the vbox-dev