diff options
Diffstat (limited to 'sugarvte')
-rw-r--r-- | sugarvte/vteview.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sugarvte/vteview.py b/sugarvte/vteview.py index 3a789c1..395d2db 100644 --- a/sugarvte/vteview.py +++ b/sugarvte/vteview.py @@ -28,6 +28,25 @@ class WordCharRange: end = None class View(Gtk.Widget, Gtk.Scrollable): + __gsignals__ = {'buffer-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, + (GObject.TYPE_PYOBJECT,)), + 'char-size-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, + (GObject.TYPE_INT, GObject.TYPE_INT)), + 'selection-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, + tuple()), + 'increase-font-size': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, + tuple()), + 'decrease-font-size': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, + tuple()), + 'text-scrolled': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, + (GObject.TYPE_INT,)), + 'copy-clipboard': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()), + 'paste-clipboard': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()), + 'copy-primary': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()), + 'paste-primary': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple())} + __gproperties__ = {'word-chars' : (GObject.TYPE_PYOBJECT, + 'word chars', '', + GObject.PARAM_READWRITE)} char_width = 1 char_height = 2 char_ascent = 3 @@ -64,9 +83,10 @@ treat all graphic non-punctuation non-space characters as word characters. self.word_chars = [] if spec == None or spec[0] == '\0': self.notify('word-chars') + return ubuf = unicode(spec) i = -1 - while i < len(ubuf): + while i + 1 < len(ubuf): i += 1 if ubuf[i] == '-': range.start = ubuf[i] @@ -86,6 +106,7 @@ treat all graphic non-punctuation non-space characters as word characters. range.start = ubuf[i] range.end = ubuf[i + 1] self.word_chars.append(range) + i += 2 continue self.notify('word-chars') |