[vbox-dev] How to create an object implementing VirtualBoxCallback from python?
Nikolay.Igotti at Sun.COM
Mon Jun 15 08:55:08 PDT 2009
Thanks for bringing our attention to this issue.
VirtualBox 3.0 will have public method in IVirtualBox
waitForEvents(timeout) designed to cover exactly this issue.
Until then, please just call some API method periodically (just like you
suggested in your message).
> Ok, I've discovered how I can do it. I had to create a class
> implementing all the callback functions in the VirtualBoxCallback
> interface and define a class attribute:
> _com_interfaces_ = xpcom.components.interfaces.IVirtualBoxCallback
> Now the problem is the callback functions are executed only when I
> call a virtualbox function from my program, and not when the event is
> produced. Is there any function I can call that puts my program to
> sleep until there is a virtualbox event? Similar to the gtk.main()
> loop, for example.
> On Sat, Jun 13, 2009 at 10:56 PM, Narf<narf at mundo-r.com> wrote:
>> 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?
> vbox-dev mailing list
> vbox-dev at virtualbox.org
More information about the vbox-dev