From d02068636f591f5749937d33f8d1cb5dd8f30480 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 17 Feb 2009 13:03:10 +0000 Subject: Add arrow head --- 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) + -- cgit v0.9.1