/[ascend]/trunk/pygtk/canvas/gaphas-test.py
ViewVC logotype

Diff of /trunk/pygtk/canvas/gaphas-test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1784 by jpye, Sat May 31 08:28:39 2008 UTC revision 1785 by jpye, Sun Jun 1 03:41:26 2008 UTC
# Line 11  from gaphas.tool import ItemTool, Rubber Line 11  from gaphas.tool import ItemTool, Rubber
11  from gaphas.geometry import point_on_rectangle, distance_rectangle_point  from gaphas.geometry import point_on_rectangle, distance_rectangle_point
12  from gaphas.constraint import LineConstraint, LessThanConstraint, EqualsConstraint  from gaphas.constraint import LineConstraint, LessThanConstraint, EqualsConstraint
13  from gaphas.canvas import CanvasProjection  from gaphas.canvas import CanvasProjection
 from gaphas.examples import Box  
14    
15  from gaphas.painter import ItemPainter  from gaphas.painter import ItemPainter
16  from gaphas import state  from gaphas import state
# Line 112  def main(): Line 111  def main():
111    
112      # Add stuff to the canvas:      # Add stuff to the canvas:
113    
     b=Box()  
     b.min_width = 20  
     b.min_height = 30  
     print 'box', b  
     b.matrix=(1.0, 0.0, 0.0, 1, 20,20)  
     b.width = b.height = 40  
     c.add(b)  
   
     bb=Box()  
     print 'box', bb  
     bb.matrix=(1.0, 0.0, 0.0, 1, 10,10)  
     c.add(bb, parent=b)  
   
     # AJM: extra boxes:  
     bb=Box()  
     print 'box', bb  
     bb.matrix.rotate(math.pi/4.)  
     c.add(bb, parent=b)  
   
     l=Line()  
     l.handles()[1].pos = (30, 30)  
     l.split_segment(0, 3)  
     l.matrix.translate(30, 60)  
     c.add(l)  
     l.orthogonal = True  
   
114      b=DefaultBlock(inputs=1,outputs=1)      b=DefaultBlock(inputs=1,outputs=1)
115      b.width = 100      b.width = 100
116      b.height = 100      b.height = 100
117      c.add(b)      c.add(b)
118        
119        # run
120      gtk.main()      gtk.main()
121    
122  if __name__ == '__main__':  if __name__ == '__main__':

Legend:
Removed from v.1784  
changed lines
  Added in v.1785

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22