'NoneType' object has no attribute 'bind'

Peter Otten __peter__ at web.de
Thu Oct 28 13:00:16 CEST 2010


Alex wrote:

> hi there, I keep getting the message in the Topic field above.
> 
> Here's my code:
> 
> self.click2=Button(root,text="Click Me").grid(column=4,row=10)

Replace the above line to

button = Button(root, text="Click Me")
print "Button() returns", button
grid = button.grid(column=4, row=10)
print ".grid() returns", grid
self.click2 = button

and be enlighted. Then remove the print statements.

> self.click2.bind("<Button-1>",self.pop2pop)
> 
> def pop2pop(self,event):
> 
>         print("Adsfadsf")
>         newpop=IntVar()
>         newpop=self.PopSize.get();
> 
> 
> what am I doing wrong?

If one step doesn't work try to replace it with smaller steps and add print 
statements to find the part that doesn't do what you expected.

Peter



More information about the Python-list mailing list