gtk.DrawingArea.__init__(self)
self.set_size_request(map_size[0] , map_size[1])
+ self.mapimage = gtk.Image()
+ p = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, self.win_x, self.win_y)
+ self.mapimage.set_from_pixbuf(p)
+
self.connect("expose-event", self.expose)
def expose(self, area, event):
center_x -= self.refpix_x
center_y -= self.refpix_y
- gc = self.style.fg_gc[gtk.STATE_NORMAL]
-
# Ranges should be long enough as to fill the screen
# Maybe they should be decided based on self.win_x, self.win_y
for i in range(-3,4) :
size_y = self.win_y - dest_y
if ( size_x > 0 and size_y > 0 ) and ( init_x < self.tile_size and init_y < self.tile_size ) :
- self.window.draw_pixbuf( gc, pixbuf, init_x, init_y, dest_x, dest_y, size_x, size_y )
+ pixbuf.copy_area( init_x, init_y, size_x, size_y, self.mapimage.get_pixbuf(), dest_x , dest_y )
del(pixbuf)
+ gc = self.style.fg_gc[gtk.STATE_NORMAL]
+ self.window.draw_pixbuf( gc, self.mapimage.get_pixbuf(), 0, 0, 0, 0, self.win_x, self.win_y )
+
def draw_paths( self ) :
center_x , center_y = self.win_x / 2 , self.win_y / 2