[Tutor] You're gridded for life.

alan.gauld@bt.com alan.gauld@bt.com
Wed, 12 Dec 2001 12:38:52 -0000


> tom_dee_lee_dum=Entry(fen).grid(row=0, column=0)
> tom_dee_lee_dum.bind("<Return>", here_I_am)

As I pointed out in my earlier post the grid() method 
returns None

Thus if you want to keep a reference to the widget you have 
to create it and then pack() or grid() it.

> tom_dee_lee_dum=Entry(fen)
> tom_dee_lee_dum.grid(row=0, column=0)
> tom_dee_lee_dum.bind("<Return>", here_I_am)

Just like that....

> So my question : is the shortcut technique only good for the 
> widgets that aren't assigned to a variable

Yes.

> This snag costed me two hours of my life 

Hmm, I did point it out last week in my original response...

The Tkinter introduction also majkes the point explicitly
http://www.pythonware.com/library/tkinter/introduction/

in section 3 "More on widget references"

I recommend Tkinter beginners go through this tutor.


> some selected curses, these very graphical ; in no tutorial 
> is "extreme tolerance to frustration" ever mentionned among 
> the qualities that make a good programmer but it really should. 

Actually I do mention that in my book :-)

Alan G.