[pygobject] Override TextBuffer.create_mark()
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Override TextBuffer.create_mark()
- Date: Sat, 27 Nov 2010 15:45:41 +0000 (UTC)
commit bf55dc862755a57bb1b998702d284fc460e88a30
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Nov 27 16:46:40 2010 +0100
Override TextBuffer.create_mark()
Override create_mark to make the left_gravity argument optional
gi/overrides/Gtk.py | 3 +++
tests/test_overrides.py | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 28211a5..b5fdbd7 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -522,6 +522,9 @@ class TextBuffer(Gtk.TextBuffer):
self._get_or_create_tag_table().add(tag)
return tag
+ def create_mark(self, mark_name, where, left_gravity=False):
+ return Gtk.TextBuffer.create_mark(self, mark_name, where, left_gravity)
+
def insert(self, iter, text):
if not isinstance(text , _basestring):
raise TypeError('text must be a string, not %s' % type(text))
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 4e41d63..0dddb3d 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -597,6 +597,9 @@ class TestGtk(unittest.TestCase):
(start, end) = buffer.get_bounds()
+ mark = buffer.create_mark(None, start)
+ self.assertFalse(mark.get_left_gravity())
+
buffer.insert(end, 'HelloHello')
buffer.insert(end, ' Bob')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]