Changeset 1828
- Timestamp:
- 08/02/07 13:45:20 (1 year ago)
- Files:
-
- gaphas/trunk/gaphas/view.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphas/trunk/gaphas/view.py
r1824 r1828 32 32 33 33 def __init__(self, canvas=None): 34 self._canvas = canvas 35 36 self._qtree = Quadtree() 34 self._matrix = Matrix() 35 self._painter = DefaultPainter() 37 36 38 37 # Handling selections. … … 42 41 self._dropzone_item = None 43 42 44 self._matrix = Matrix()45 self._painter = DefaultPainter()46 47 43 self._dirty_items = set() 48 44 self._dirty_matrix_items = set() 49 45 46 self._qtree = Quadtree() 47 48 self._canvas = None 49 if canvas: 50 self._set_canvas(canvas) 51 50 52 51 53 matrix = property(lambda s: s._matrix, … … 59 61 """ 60 62 if self._canvas: 63 self._canvas.unregister_view(self) 61 64 self._qtree = Quadtree() 62 65 … … 65 68 66 69 if self._canvas: 67 self. request_update(self._canvas.get_all_items())70 self._canvas.register_view(self) 68 71 69 72 canvas = property(lambda s: s._canvas, _set_canvas) … … 424 427 This extends the behaviour of View.canvas. 425 428 """ 426 if self._canvas:427 self._canvas.unregister_view(self)428 429 429 super(GtkView, self)._set_canvas(canvas) 430 430 431 431 if self._canvas: 432 self. _canvas.register_view(self)432 self.request_update(self._canvas.get_all_items()) 433 433 434 434 … … 625 625 """ 626 626 gtk.DrawingArea.do_size_allocate(self, allocation) 627 # doesn't work: super(GtkView, self).do_size_allocate(allocation)628 627 self.update_adjustments(allocation) 628 self._qtree.resize((0, 0, allocation.width, allocation.height)) 629 629 630 630 631 631 def do_realize(self): 632 #super(GtkView, self).do_realize()633 632 gtk.DrawingArea.do_realize(self) 633 allocation = self.allocation 634 print 'allocation', allocation.width, allocation.height 635 634 636 if self._canvas: 635 637 self.request_update(self._canvas.get_all_items())
