Jefferythewind
August 8th, 2010, 03:31 PM
Hi everyone,
I am making a little application that reads serial data and then draws on a gtk.DrawingArea. I get the out put from an accelerometer. Anyways, I want to make this application refresh automatically, so it will be like a small animation. I searched around the web and found:
gobject.timeout_add(ms, fn)
and I have seen some examples, but when i run my code I get this error:
self.timer = gobject.timeout_add(10, draw_vector())
NameError: global name 'gobject' is not defined
I have tried using:
window.timeout_add(10, draw_vector())
but it doesn't work either
I have attached my python script and the line in question is 108.
thanks for any help.
I am making a little application that reads serial data and then draws on a gtk.DrawingArea. I get the out put from an accelerometer. Anyways, I want to make this application refresh automatically, so it will be like a small animation. I searched around the web and found:
gobject.timeout_add(ms, fn)
and I have seen some examples, but when i run my code I get this error:
self.timer = gobject.timeout_add(10, draw_vector())
NameError: global name 'gobject' is not defined
I have tried using:
window.timeout_add(10, draw_vector())
but it doesn't work either
I have attached my python script and the line in question is 108.
thanks for any help.