Problem with tabbing from multiline text control to a group of wx.Radio buttons

9 views
Skip to first unread message

Sam23

unread,
Aug 19, 2009, 12:00:39 PM8/19/09
to wxPytho...@googlegroups.com
I have a problem with tabbing to wx.Radio buttons which I found out was due to a multi-line text control. I attach a sample code that shows the problem. Is there something I missed doing, or is there a way to get around this problem?

To see problem.
* Run the attached file: radios.py
* The second radio button ('bb')of Abc Radios group is selected.  The cursor is at the first input element, which is  a multiline text control.
* Press <Tab>. The focus changes to Abc Radio. The selected radio changes to the first radio button 'a'.  It should remain at 'bb'. This is the problem.
* If you are at the last input element, and press 'Shift-tab' to jump to Abc Radios, the selected radio button will not change.But if you tab from the first input element, Abc radios will always change to the first radio button.

If you change the first text control to be a single line control, then this errant behaviour goes away.  (Comment Line 17  and uncomment Line 18).

If you delete lines 7 to 11, then the controls will all be drawn directly on the wx.Frame instead of in wx.Panel (OutermostPanel). Then this behaviour disappears too --- <Tab> simply inserts a tab within the multiline control.  But this is not what I want - I want to have controls drawn on wx.Panel so that I can control the background colour.

I am running wx.Python 2.8.9.2 in Windows XP
radios.py

Robin Dunn

unread,
Aug 19, 2009, 2:49:00 PM8/19/09
to wxpytho...@googlegroups.com
Sam23 wrote:
> I have a problem with tabbing to wx.Radio buttons which I found out was
> due to a multi-line text control. I attach a sample code that shows the
> problem. Is there something I missed doing, or is there a way to get
> around this problem?
>
> To see problem.
> * Run the attached file: radios.py
> * The second radio button ('bb')of Abc Radios group is selected. The
> cursor is at the first input element, which is a multiline text control.
> * Press <Tab>. The focus changes to Abc Radio. The selected radio
> changes to the first radio button 'a'. It should remain at 'bb'. This
> is the problem.
> * If you are at the last input element, and press 'Shift-tab' to jump to
> Abc Radios, the selected radio button will not change.But if you tab
> from the first input element, Abc radios will always change to the first
> radio button.
>

Have you tried using a wx.RadioBox instead of a series of wx.RadioButtons?

--
Robin Dunn
Software Craftsman
http://wxPython.org

Sam23

unread,
Aug 20, 2009, 3:57:57 AM8/20/09
to wxpytho...@googlegroups.com
Robin Dunn wrote the following on 8/20/2009 2:49 AM:
Have you tried using a wx.RadioBox instead of a series of wx.RadioButtons?
This problem doesn't happen with wx.RadioBox. I started with wx.RadioBox, but I switched to wx.RadioButtons, which is a bit more work, because I wanted to be able to control the spacing between the radio buttons. If you look at the sample code, you can see that I control the spacing between the radio buttons using a sizer. I could simulate this with wx.RadioBox to some extent by putting trailing spaces in the choice labels, but it doesn't work as well.

Reply all
Reply to author
Forward
0 new messages