Re: [Tkinter-discuss] Unexpected Checkbutton behaviour

2006-11-29 Thread Gerardo Juarez
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

Re: [Tkinter-discuss] Unexpected Checkbutton behaviour

2006-11-28 Thread Fredrik Lundh
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

Re: [Tkinter-discuss] Unexpected Checkbutton behaviour

2006-11-28 Thread Cam
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

[Tkinter-discuss] Unexpected Checkbutton behaviour

2006-11-28 Thread Gerardo Juarez
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