Amit Finkler wrote:
RunFrame = Tkinter.Frame(win1, bd = 2, relief = 'groove')
your use of excessive whitespace doesn't exactly make it easier to read
your code... I suggest reading PEP 8.
Run2D = Tkinter.Radiobutton(RunFrame, text = text, variable =
hs, value = mode, command = Hide_Show_2D(hs))
Run2D.pack(side = 'left')
when you write
command=Hide_Show_2D(hs)
Python will *call* the function, take the return value from the
function, and pass *that* to the Radiobutton. try inserting a
lambda:
command=lambda: Hide_Show_2D(hs)
("lambda: expression" creates an anonymous function that evaluates the
expression when called).
def Hide_Show_2D(value):
if value == '2':
win4.withdraw()
else:
win4.deiconify()
since "value" is a Tkinter StringVar, you have to replace the test with
value.get() == '2'
(alternatively, change the lambda to "lambda: Hide_Show_2D(hs.get())")
</F>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss