diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2013-04-11 13:29:42 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2013-04-11 13:29:42 (GMT) |
commit | 947c489b1296de7ad0f20788467690ab75aec57f (patch) | |
tree | 58b0ff6dfdb3b39c19db9e08f2798c7d1954a33f | |
parent | 2d2cae33384294e5c83ae5f9c8a7fbf959521ce4 (diff) |
Avoid multiple redraw
The draw rutine triggered a movement of the textview used to edit
textviewxt, triggering a new draw, in a continues loop.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r-- | historietaactivity.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/historietaactivity.py b/historietaactivity.py index 7b623d3..1db3c30 100644 --- a/historietaactivity.py +++ b/historietaactivity.py @@ -469,6 +469,8 @@ class ComicBox(Gtk.EventBox): self.textview.modify_bg(Gtk.StateType.NORMAL, style.COLOR_TEXT_FIELD_GREY.get_gdk_color()) + self._textview_x = 0 + self._textview_y = 0 self.fixed.put(self.textviewbox, 0, 0) self.textviewbox.pack_start(self.textview, True, False, 0) @@ -718,5 +720,8 @@ class ComicBox(Gtk.EventBox): self.redraw() def move_textview(self, x, y): - self.fixed.move(self.textviewbox, x, y) - self.textviewbox.show_all() + if self._textview_x != x or self._textview_y != y: + self._textview_x = x + self._textview_y = y + self.fixed.move(self.textviewbox, x, y) + self.textviewbox.show_all() |