From 2b2dbc809955093f98884e6619bd8a88be751c16 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 22 May 2006 13:36:58 -0400 Subject: [PATCH] Clear the setchpad after sending --- sugar/chat/chat.py | 1 + sugar/chat/sketchpad/SketchPad.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sugar/chat/chat.py b/sugar/chat/chat.py index dfce873c..c25585f6 100755 --- a/sugar/chat/chat.py +++ b/sugar/chat/chat.py @@ -70,6 +70,7 @@ class Chat(activity.Activity): def __send_button_clicked_cb(self, button): self.send_sketch(self._sketchpad.to_svg()) + self._sketchpad.clear() def _color_selected(self, toolbox, color): self._sketchpad.set_color(color) diff --git a/sugar/chat/sketchpad/SketchPad.py b/sugar/chat/sketchpad/SketchPad.py index d19ca401..6245a25f 100644 --- a/sugar/chat/sketchpad/SketchPad.py +++ b/sugar/chat/sketchpad/SketchPad.py @@ -22,6 +22,10 @@ class SketchPad(gtk.DrawingArea): self.connect("button-release-event", self.__button_release_cb) self.connect("motion-notify-event", self.__motion_notify_cb) self.connect('expose_event', self.expose) + + def clear(self): + self._sketches = [] + self.window.invalidate_rect(None, False) def expose(self, widget, event): """Draw the background of the sketchpad."""