[wxpython-users] Can a group of radio buttons be used as a one-click selection ?

C M cmpython at gmail.com
Sat May 10 02:11:46 PDT 2008


On Sat, May 10, 2008 at 4:37 AM, Stef Mientki <s.mientki at ru.nl> wrote:
> hi Che,
>
> C M wrote:
>>
>> On Fri, May 9, 2008 at 8:44 PM, Stef Mientki <s.mientki at ru.nl> wrote:
>>
>>>
>>> hello,
>>>
>>> I want a group of radio buttons,
>>> where clicking on one of the buttons,
>>> should perform some action.
>>> Now this works as long as I don't select the same (already selected)
>>> Radiobutton.
>>>
>>
>> First, just a contention:  What would be the (visual) logic of
>> clicking something that is already selected?  Wouldn't the state of
>> your GUI/app be as that radioButton indicates already?  If others are
>> to use this, I would argue that users might think this way too (or you
>> could argue that this is a good paradigm switch!).
>>
>
> Yes, the program I'm working on is a windows mobile emulator,
> and on windows mobile.
> a click on an already selected item has effect
> (which is indeed an improvement for those devices).
>>
>> But it should work if you call event.Skip() to allow the button to
>> "popped" after you tell it to perform some action.  Maybe you were
>> leaving that out?  See a working sample attached.
>>
>
> Thanks,
> that was indeed the problem
> ( I didn't know that EVT_LEFT_DOWN could block the EVT_RADIOBUTTON)

hi Stef,
This page has some good info on how events can stop propagating, as
had happened originally in your case without event.Skip():
http://wiki.wxpython.org/EventPropagation
Che


More information about the wxpython-users mailing list