Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-02-17 13:03:10 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-02-17 13:03:10 (GMT)
commitd02068636f591f5749937d33f8d1cb5dd8f30480 (patch)
tree8ea27ee6962b459dc75afb0852d6aa554f13addb
parent58e08c44c29b0b85fcf4931640fac7a171177de5 (diff)
Add arrow head
-rw-r--r--view.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/view.py b/view.py
index cc63a84..cc77142 100644
--- a/view.py
+++ b/view.py
@@ -117,7 +117,7 @@ class MindMapView(GtkView):
handle_tool = tool.ConnectHandleTool()
if thought_view.line_to_parent is None:
- line = Line()
+ line = Connection()
self.canvas.add(line)
thought_view.line_to_parent = line
else:
@@ -252,3 +252,24 @@ class ItemTool(tool.ItemTool):
tool.ItemTool.on_button_release(self, context, event)
+class Connection(Line):
+ def __init__(self):
+ super(Connection, self).__init__()
+
+ def draw_head(self, context):
+ cr = context.cairo
+ cr.move_to(2, 0)
+ cr.line_to(12, 10)
+ cr.stroke()
+
+ cr.move_to(2, 0)
+ cr.line_to(12, -10)
+ cr.stroke()
+
+ super(Connection, self).draw_head(context)
+
+ def draw(self, context):
+ cr = context.cairo
+ cr.set_source_rgb(0, 0, .8)
+ super(Connection, self).draw(context)
+