diff options
Diffstat (limited to 'fft_mouth.py')
-rw-r--r-- | fft_mouth.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fft_mouth.py b/fft_mouth.py index 8200ef6..f91d900 100644 --- a/fft_mouth.py +++ b/fft_mouth.py @@ -93,7 +93,7 @@ class FFTMouth(Mouth): self.peaks = val - def expose(self, widget, event): + def do_draw(self, context): """This function is the "expose" event handler and does all the drawing.""" @@ -102,15 +102,15 @@ class FFTMouth(Mouth): self.processBuffer(bounds) #Create context, disable antialiasing - self.context = widget.window.cairo_create() - self.context.set_antialias(cairo.ANTIALIAS_NONE) + self.context = context + #self.context.set_antialias(cairo.ANTIALIAS_NONE) #set a clip region for the expose event. #This reduces redrawing work (and time) - self.context.rectangle(event.area.x, - event.area.y, - event.area.width, - event.area.height) + self.context.rectangle(bounds.x, + bounds.y, + bounds.width, + bounds.height) self.context.clip() # background |