def init(self): if self.fInit: return self.fInit = 1 print "init", self # line self.fLineToOwner = Canvas.Line(self.fCanvas, 0, 0, 0, 0, fill='gray30', width=1) # disc self.fDisc = Canvas.Oval(self.fCanvas, 0, 0, 0, 0) self.fDisc.config(width=1) outlineColor, fillColor = Node.kColors[self.xType] self.fDisc.config(outline=outlineColor, fill=fillColor) Node.DiscToNode[self.fDisc] = self outlineColor, fillColor = Node.kColors[self.xType] self.fDisc.config(outline=outlineColor, fill=fillColor) # label self.fLabel = Canvas.CanvasText(self.fCanvas, 0, 0, font=('helvetica', 8), justify='center', anchor='s', text='')
def init(self): self.fHighlight = Canvas.Oval(self.fCanvas, 0, 0, 0, 0) self.fHighlight.config(outline="#FF0000", width="1") self.fLabel = Canvas.CanvasText(self.fCanvas, 7, 7, font=('courier', 8), justify='left', anchor='nw', text='')
def __init__(self, canvas, addr, files, parent=None, conn=None): (self.canvas, self.addr, self.files, self.parent, self.conn) = (canvas, addr, files, parent, conn) self.children = [] self.neighbours = {} self.error = None self.counts = {} (self.size, self.bold) = getsize(files) self.oval = None self.branch = None self.query = None self.text = None # The two following lines where throwing an exception, therefore I commented them =P # if not parent and self.parent.insert(self): # pass (self.radius, self.amin, self.amax) = (0.0, 0.0, 360.0) (self.x, self.y) = self.xy() self.oval = Canvas.Oval(canvas, 0, 0, 0, 0) Host.ovaltohost[self.oval] = self self.branch = None self.text = None if self.parent: self.branch = MakeLine(self, self.parent, Host.DIRECT_LINE) self.text = Canvas.CanvasText(canvas, self.x, self.y, font=('helvetica', 8), justify='center') self.query = Canvas.CanvasText(canvas, self.x, self.y, font=('helvetica', 8), justify='left', anchor='s', text='') self.resize(files) self.setstate(Host.QUEUED) self.canvas.update() time.sleep(TF * 0.05)