Monday, 15 September 2014

Tkinter Error when using Entry Delete Method -



Tkinter Error when using Entry Delete Method -

in game, have __init__ function creates set of 7 entry boxes, so:

self.string1 = stringval() self.entry1 = entry(frame, textvariable = self.string1).grid(row = 4, column = 1, sticky = w)

this copied 6 more times. works. @ end of game, though, want delete entry box's text, using code found several places online:

self.entry1.delete(0, end)

i tried using else found:

if self.entry1.get(): self.entry1.delete(0, end)

these both self.entry1 nonetype object, , has no method .get() or .delete(). seek things out, substituted self.entry1.get() , self.entry1.delete(0,end) self.string1.get(), etc. tried substituting .delete(0, end) .delete(0.0, end). neither of these worked either. not understand doing wrong. help!

when this:

self.foo = button(...).grid(...)

... gets stored in self.foo result of phone call grid(). none. need separate widget creation loyout in order save reference created widgets.

methods tkinter typeerror entry

No comments:

Post a Comment