Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mapview.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2014-04-11 02:03:54 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-05-14 21:21:41 (GMT)
commit24bf5a350a4e029c6b3eb10484826a9924c2aff5 (patch)
tree93a4136a6f81eee4df3f1f0f97a35e07c0fe8fec /mapview.py
parentdd749da6fdc05374ee656762f6c34d2c52ca6779 (diff)
Change expose events to draw
Diffstat (limited to 'mapview.py')
-rw-r--r--mapview.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/mapview.py b/mapview.py
index 1966f03..d6c0b92 100644
--- a/mapview.py
+++ b/mapview.py
@@ -120,7 +120,7 @@ class TopMapView(Gtk.DrawingArea):
self._show_position = None
super(TopMapView, self).__init__()
self.set_size_request(width, height)
- self.connect('expose_event', self.expose)
+ self.connect('draw', self.__draw_cb)
def show_position(self, x, y, direction):
self._show_position = {'x': x, 'y': y, 'direction': direction}
@@ -130,14 +130,12 @@ class TopMapView(Gtk.DrawingArea):
self._show_position = None
self.queue_draw()
- def expose(self, widget, event):
- #rect = self.get_allocation()
- ctx = widget.window.cairo_create()
+ def __draw_cb(self, widget, ctx):
ctx.save()
# set a clip region for the expose event
- ctx.rectangle(event.area.x, event.area.y, event.area.width,
- event.area.height)
- ctx.clip()
+ #ctx.rectangle(event.area.x, event.area.y, event.area.width,
+ # event.area.height)
+ #ctx.clip()
view_data = {'width': self._width, 'height': self._height,
'show_position': self._show_position}