Unfalsifiable radio buttons

Franz Steinhaeusler wrote:

···

On Sun, 2 Apr 2006 15:43:59 -0500 (CDT), Marc Hedlund <marc@precipice.org> wrote:

Hi,

I'm try to initialize a group of radio buttons (not a radio box) so that none of them are selected by default. On Mac (MacOS X 10.4.5; stock Python 2.3.5; wxPython 2.6.2.1), the attached code works fine for this. On Windows (Windows 2000; Python 2.3.5; wxPython 2.6.2.1), the first radio button ("One" in the demo) always comes up selected. I can set some other button to be selected, but I can't get it to come up with no button selected.

Is there a way around this?

Thanks,
-M

If you change radio.SetValue(False)
to: wx.CallAfter (radio.SetValue, False)

then nothing is selected.

But why this is needed, maybe Robin knows ...

There is probably something happening in idle time or other followup events that is scanning the rb group and ensuring that a single item is set. However since by definition radio buttons in a group should always have exactly one item selected, the fact that this CallAfter workaround works (and also the Mac behavior) could be considered a bug. In fact, the workaround doesn't work on wxGTK.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!