"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';
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
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
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
"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