def __init__(self, master, w, h, **options): self.master = master self.width, self.height, self.options = w, h, options self.mainFrame = tk.Frame(self.master) self.cells = [] self.activeColor = tk.dictGet(options, "activeColor", "black") self.hoverColor = tk.dictGet(options, "hoverColor", "blue") self.outlineColor = tk.dictGet(options, "outlineColor", "black") self.graph = graph.GraphWin(self.mainFrame, **options) self.graph.grid() self.draw() self.graph.update()
def __init__(self, master, width, height, **options): self.master = master self.mainFrame = tk.Frame(self.master) self.width, self.height = width, height self.activeColor = tk.dictGet(options, "activeColor", "black") self.hoverColor = tk.dictGet(options, "hoverColor", "blue") self.outlineColor = tk.dictGet(options, "outlineColor", "black") self.graph = tk.Canvas(self.mainFrame, width = self.width, height = self.height, **options) self.graph.grid() self.graph.bind("<Button-1>", lambda event: self.click(event.x, event.y)) self.graph.bind("<B1-Motion>", lambda event: self.click(event.x, event.y)) self.setBackground("white") self.cells = {} self.edit = True