Re: [Tutor] Checkbox problem in Tkinter

2011-01-10 Thread Alan Gauld
"Peter Otten" <__pete...@web.de> wrote I can select/deselect it with the mouse. its just the change to the variable that is broken. This was the problem using the Stringvar. Then var changes OK. Here is my code(from Pythonwin): def f(): global var; var = 'on' if var == 'off' else 'off';

Re: [Tutor] Checkbox problem in Tkinter

2011-01-10 Thread Peter Otten
ANKUR AGGARWAL wrote: > Hey I write this code up > > from Tkinter import * > root=Tk() > var=StringVar() > c=Checkbutton(root,text="hello",variable=var,onvalue="",offvalue="") > c.pack() > root.mainloop() > > and i got the output as - > [image: Screenshot.png] > > When i take the var a

Re: [Tutor] Checkbox problem in Tkinter

2011-01-10 Thread Peter Otten
Alan Gauld wrote: > > "ANKUR AGGARWAL" wrote > >> from Tkinter import * >> root=Tk() >> var=StringVar() >> c=Checkbutton(root,text="hello",variable=var,onvalue="",offvalue="") >> c.pack() >> root.mainloop() > > FWIW I get a different problem, namely that the var does not seem > to get

Re: [Tutor] Checkbox problem in Tkinter

2011-01-10 Thread Peter Otten
ANKUR AGGARWAL wrote: > and i got the output as - > [image: Screenshot.png] The image doesn't survive. > When i take the var as of string variable type i am unable to edit the > checkbox. It comes slected predefined and the widget in kindof Invisible > and > u can say uneditable. Can anybody t

Re: [Tutor] Checkbox problem in Tkinter

2011-01-10 Thread Alan Gauld
"ANKUR AGGARWAL" wrote from Tkinter import * root=Tk() var=StringVar() c=Checkbutton(root,text="hello",variable=var,onvalue="",offvalue="") c.pack() root.mainloop() FWIW I get a different problem, namely that the var does not seem to get updated nor does changling the var seem to alt