Exemple #1
0
 def __init__(self, canvas, x, y, name, arguments, defining_frame,
              body="..."):
     Draggable.__init__(self, canvas)
     self.shape = canvas.create_polygon(x, y, x+140, y, x+140, y+30,
             x+150, y+30, x+150, y+60, x+10, y+60, x+10, y+30, x, y+30,
             tag=self.tag, fill="white", outline="white")
     self.static_link = StaticLink(canvas, self, defining_frame)
     canvas.create_line(x, y, x+140, y, x+140, y+30, x+150, y+30,
             tag=self.tag)
     canvas.create_line(x, y+30, x+10, y+30, x+10, y+60, x+150, y+60,
             tag=self.tag)
     canvas.create_oval(x+125, y-15, x+155, y+15, tag=self.tag, fill="white")
     canvas.create_oval(x+135, y-5, x+145, y+5, tag=self.tag, fill="black")
     self.name = canvas.create_text(x, y+5, tag=self.tag, anchor=tk.NW,
                                    text=name+"("+", ".join(arguments)+"):")
     self.body = canvas.create_text(x+15, y+35, tag=self.tag, anchor=tk.NW,
                                    text=body)
Exemple #2
0
 def __init__(self, canvas, x, y, globe=False, extended_frame=None):
     Draggable.__init__(self, canvas)
     self.bindings = [] # List of bindings from variables to values
     self.rect = canvas.create_rectangle(x, y, x + self.width, y +
                                         self.height, tag=self.tag,
                                         fill="white")
     canvas.create_oval(x+135, y-15, x+165, y+15, tag=self.tag,
                        fill="white")
     if globe:
         pass #Shouldn't we still draw a globe?
     else:
         canvas.create_oval(x+145, y-5, x+155, y+5, tag=self.tag,
                                 fill="black")
     if extended_frame is not None:
         self.extend(extended_frame)
     else:
         self.static_link = None
Exemple #3
0
 def move(self, dx, dy):
     Draggable.move(self, dx, dy)
     for binding in self.bindings:
         binding.move(dx, dy)