[Tkinter-discuss] entry+value assignment using function

Alex Ter-Sarkissov sigma.z.1980 at gmail.com
Sun Oct 31 07:57:29 CET 2010


hi, here's my situation:

I create an Entry outside of a certai function*:

self.newlab=Entry(root,state=DISABLED).grid(column=4,row=9)*

the function acquires a value (from another Entry) and puts this value into
the Entry created in the command above. The way I do it is

def pop2pop(self,event):

        newpop=IntVar()
        newpop.set(self.PopSize.get())
        #newpop=self.PopSize.get()

        self.newlab['textvariable']=newpop


and it doens't work. Suprisingly, when I create the Entry within this
function (e.g.

  self.newlab=Entry(root,textvariable=newpop).grid(column=4,row=9)

it works.

More over, the assignment of the value to newpop as
(newpop=self.PopSize.get()) doesn't work either, so I have to use
newpop.set(self.PopSize.get()) instead.

what am I doing wrong?

cheers,

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20101031/3dcd7588/attachment.html>


More information about the Tkinter-discuss mailing list