[dots] Update review line when cursor-position property has changed.
- From: Fernando Herrera de las Heras <fherrera src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dots] Update review line when cursor-position property has changed.
- Date: Wed, 1 Dec 2010 21:33:54 +0000 (UTC)
commit 13078ac57e618d4d17bd9b3b0c7a7d495ecc1438
Author: Fernando Herrera <fherrera onirica com>
Date: Wed Dec 1 21:31:59 2010 +0100
Update review line when cursor-position property has changed.
dots/dots_project.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/dots/dots_project.py b/dots/dots_project.py
index 5e2fc62..7173232 100644
--- a/dots/dots_project.py
+++ b/dots/dots_project.py
@@ -28,17 +28,20 @@ class DotsProject(gobject.GObject):
self.view = view
self.view.set_sensitive(True)
#self.view.modify_font(pango.FontDescription('Mono'))
- self.view.connect_after("move-cursor", self._onMoved)
self.buffer = gtk.TextBuffer()
self.braille_buffer = gtk.TextBuffer()
+ self.buffer.connect("notify", self._onBufferPropChanged)
+ self.braille_buffer.connect("notify", self._onBufferPropChanged)
self.document = document
self.out_file = None
self.config = None
self.current_line = None
- def _onMoved(self, view, step, count, extend_selection):
- mark = view.get_buffer().get_mark("insert")
- iter = view.get_buffer().get_iter_at_mark(mark)
+ def _onBufferPropChanged(self, buffer, paramspec):
+ if paramspec.name != 'cursor-position':
+ return
+ mark = buffer.get_mark("insert")
+ iter = buffer.get_iter_at_mark(mark)
line = iter.get_line()
start = self.buffer.get_iter_at_line(line)
end = start.copy()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]