Hi

I now get stucked in the arguments of the buttons
Here's what I've got:

def crearbutton(self):
        for i in range(self.fil):
            for j in range(self.col):
                
self.buttonmatrix[i][j]=Button(root,width=1,height=0,command=lambda: 
self.hello(i,j))
                self.buttonmatrix[i][j].grid(row=i,column=j,sticky=N+S+W+E)

def hello(self,f,c):
    self.buttonmatrix[f][c].configure(text="ddddd")

I'm trying to create the buttons dinamically (that's not a problem) the 
problem is wherever I click the hello function returns the last button I 
created. I know that the problem is in the lambda part and that the variable 
i (the one I change the value within the for) but I don't how to fix it

Any hints?

Thanks in advanced

Alberto


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to