The value of the entry widget doesn't get updated
tiissa
tiissa at nonfree.fr
Tue Apr 19 16:02:15 EDT 2005
Clara wrote:
<SNIP>
> self.loginButton = Button(self, text='Login', command =
> VerifyProcessor(self.x.get(), self.y.get()) )
<SNIP>
>
> class VerifyProcessor:
>
> def __init__(self, thename, thepass):
> self.username = thename
> self.password = thepass
>
> def __call__(self):
> print self.username
> print self.password
Your VerifyProcessor object is constructed just before your loginButton,
not when you click.
Therefore you may want to pass the x and y StringVars to its __init__
function instead of their value at contruction. Therefore your __call__
method can .get() their values each time the button is clicked.
More information about the Python-list
mailing list