multiple check boxes

Peter Otten __peter__ at web.de
Sat Nov 1 04:34:42 EST 2003


Harish Vaidya wrote:

> 
> hi,
> i am trying to use multiple checkboxes.
> what is happening is once select check box its
> variable is not getting set. below is the code. what
> could be the problem? i am using python 2.0
> thanks in advance

I do not fully understand what you're are trying to achieve with your code,
but this observation might help you anyway:

[...]
>        b1 = Button(top,
> text='OK!',command=TestCases())
[...]
>     b = Button(root, text='OK!',command=hostTC())
[...]

In both cases you do the eqivalent of

b = Button(..., command=None)

as both TestCases() and hostTC() do not explicitly return a value.
You probably want the buttons to invoke TestCases() or hostTC(), and you
therefore must omit the trailing (), e. g.:

b = Button(root, text='OK!',command=hostTC)

Peter




More information about the Python-list mailing list