Oooh I see! I knew it was a small thing I was overlooking. I read in
the reference "Tkinter variable", but I never gave it the meaning it
really had. Thanks everyone!
Gerardo
On Wed, 29 Nov 2006, Fredrik Lundh wrote:
> Gerardo Juarez wrote:
>
>
> > I'm having problems with a widget, which
Gerardo Juarez wrote:
> I'm having problems with a widget, which I've been able to isolate to the
> following example:
>
> from Tkinter import *
>
> def display():
> global x
> print x
>
> root = Tk()
> x = 0
> check = Checkbutton(root, variable=x)
> check.pack()
> button = Button(te
Hi Gerardo,
You can't user a regular python variable for "x", you need to create, in
this case, an IntVar "control variable". See revised code below, also
see http://infohost.nmt.edu/tcc/help/pubs/tkinter/control-variables.html
Cam Farnell
from Tkinter import *
def display():
print x.g
Hi,
I'm having problems with a widget, which I've been able to isolate to the
following example:
from Tkinter import *
def display():
global x
print x
root = Tk()
x = 0
check = Checkbutton(root, variable=x)
check.pack()
button = Button(text='Display variable', command=display)
butto