'NoneType' object has no attribute 'bind'

Xavier Ho contact at xavierho.com
Thu Oct 28 06:29:50 EDT 2010


On 28 October 2010 20:24, Alex <sigma.z.1980 at gmail.com> 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)
> self.click2.bind("<Button-1>",self.pop2pop)
> what am I doing wrong?
>

Try

self.click2=Button(root,text="Click Me")
self.click2.grid(column=4,row=10)
self.click2.bind("<Button-1>",self.pop2pop)

Chances are, the grid() method modifies the object in-place without
returning a self reference. This is a common getcha.

Cheers,
Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101028/8f14389b/attachment-0001.html>


More information about the Python-list mailing list