[gtksourceview] Fix mark attributes api usage in the python test.
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Fix mark attributes api usage in the python test.
- Date: Sun, 16 Jan 2011 12:56:34 +0000 (UTC)
commit 3ff4fcedf7d971886d3e836d7bdcc7ed26ea50e0
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Jan 16 13:56:21 2011 +0100
Fix mark attributes api usage in the python test.
tests/test-widget.py | 38 ++++++++++++++++----------------------
1 files changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/tests/test-widget.py b/tests/test-widget.py
index 38cecee..c7a50a6 100644
--- a/tests/test-widget.py
+++ b/tests/test-widget.py
@@ -282,35 +282,29 @@ class Window(Gtk.Window):
action_group.get_action("IndentWidthUnset").set_active(True)
def add_source_mark_pixbufs(self):
- cat = self._view.get_mark_category(self.MARK_TYPE_1)
-
- """ FIXME: no idea how to annotate GdkRGBA
- parsed, color = Gdk.RGBA.parse("lightgreen")
+ attrs = GtkSource.MarkAttributes ();
+ color = Gdk.RGBA();
+ parsed = color.parse("lightgreen")
if parsed:
- cat.set_background(color)
- """
-
- cat.set_stock_id(Gtk.STOCK_YES)
- cat.set_priority(1)
- cat.connect("query-tooltip-markup", self.mark_tooltip_func)
-
- cat = self._view.get_mark_category(self.MARK_TYPE_2)
-
- """ FIXME
- parsed, color = Gdk.RGBA.parse("pink")
+ attrs.set_background(color)
+ attrs.set_stock_id(Gtk.STOCK_YES)
+ attrs.connect("query-tooltip-markup", self.mark_tooltip_func)
+ self._view.set_mark_attributes (self.MARK_TYPE_1, attrs, 1)
+
+ attrs = GtkSource.MarkAttributes ();
+ color = Gdk.RGBA();
+ parsed = color.parse("pink")
if parsed:
- cat.set_mark_category_background(color)
- """
-
- cat.set_stock_id(Gtk.STOCK_NO)
- cat.set_priority(2)
- cat.connect("query-tooltip-markup", self.mark_tooltip_func)
+ attrs.set_background(color)
+ attrs.set_stock_id(Gtk.STOCK_NO)
+ attrs.connect("query-tooltip-markup", self.mark_tooltip_func)
+ self._view.set_mark_attributes (self.MARK_TYPE_2, attrs, 2)
def remove_all_marks(self):
start, end = self._buf.get_bounds()
self._buf.remove_source_marks(start, end, None)
- def mark_tooltip_func(self, mark, user_data):
+ def mark_tooltip_func(self, attrs, mark):
i = self._buf.get_iter_at_mark(mark)
line = i.get_line() + 1
column = i.get_line_offset()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]