def __init__(self): Frame.__init__(self) self.master.title("Same Game") self.master.rowconfigure(0, weight=1) self.master.columnconfigure(0, weight=1) self.grid(sticky=W + E + N + S) self.buttons = [] r = 10 c = 10 x = 3 self.game = SameGame(r, c, x) for i in range(0, r): tmpButtons = [] self.buttons.append(tmpButtons) for j in range(0, c): #self.tmpFrame = Frame(self.frame, bd=1, relief=SUNKEN) #self.tmpFrame.grid(row=i, column=j, sticky=N+E+W+S) self.buttons[i].append( Button(self, bg="grey", command=lambda arg1=i, arg2=j: self.buttonHandler( arg1, arg2))) self.buttons[i][j].bind("<Return>", lambda event, arg1=i, arg2=j: self. buttonHandler_a(event, arg1, arg2)) self.buttons[i][j].grid(row=i, column=j, sticky=N + E + W + S) self.display() self.master.rowconfigure(1, weight=1) self.master.columnconfigure(1, weight=1)