I need help! (but specifically with a radio-buttons problem).
Attached is a simplified program. Sorry for length - I hope its simple
enough. I'm running Python 2.2.2, wxPython 2.4.0.2 on windows ME.
Its a simplified screen from a program that keeps track of footy tipping.
There are 8 pairs of radio buttons. When tips are loaded from the file, the
appropriate selection should show on the screen. (I have no doublt there are
more elegant ways of doing it than in this sample (and I welcome any
comments on that as well), but the structure is just reproducing what is
done in the program.
I can show the correct selections very easily with radio boxes - similar
iterations & checking produces correct results.
But when I changed to using radio buttons (so that I can allow for neither
button to be selected), for some reason blanks show up.
In the sample, changing the selection in the choice triggers an event which
load & shows the tips. There is a print statment which shows the state of
the first radio button of Game 2 in the consol window. As the program
iterates through games 1 to 8, it initially sets this to true (as it should)
as it checks game 2. But after checking game 6, the selected radio button in
Game 2 becomes unselected. I can't work out why. With different tip/label
combinations, this behaviour shows up on other groups of radiobuttons.
The gui is built with wxGlade, but I can't see any faults in the way that
the radiobuttons are scripted. It works as expected when selecting radio
buttons manually.
If it's an error in my logic, I apologise in advance. I have spent quite a
few hours trying to narrow it down, but I can't find what is unselecting the
radio button. If line 119 is changed so the range stops before game 6, then
the problem does not show up. If just Game 2 then Game 6 are selected, the
problems shows up (the commented out lines at 129).
TIA,
Chris.
RadioButtons.py (6.95 KB)