Clear the setchpad after sending

This commit is contained in:
Marco Pesenti Gritti 2006-05-22 13:36:58 -04:00
parent 8b4a4e2afe
commit 2b2dbc8099
2 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,7 @@ class Chat(activity.Activity):
def __send_button_clicked_cb(self, button): def __send_button_clicked_cb(self, button):
self.send_sketch(self._sketchpad.to_svg()) self.send_sketch(self._sketchpad.to_svg())
self._sketchpad.clear()
def _color_selected(self, toolbox, color): def _color_selected(self, toolbox, color):
self._sketchpad.set_color(color) self._sketchpad.set_color(color)

View File

@ -23,6 +23,10 @@ class SketchPad(gtk.DrawingArea):
self.connect("motion-notify-event", self.__motion_notify_cb) self.connect("motion-notify-event", self.__motion_notify_cb)
self.connect('expose_event', self.expose) self.connect('expose_event', self.expose)
def clear(self):
self._sketches = []
self.window.invalidate_rect(None, False)
def expose(self, widget, event): def expose(self, widget, event):
"""Draw the background of the sketchpad.""" """Draw the background of the sketchpad."""
rect = self.get_allocation() rect = self.get_allocation()