wxChoice on Mac OS

Hi.
I´m having trouble with code that works perfectly well on the Windows platform but when moved to a Mac OS seems to break. Namely there are the following issues with the wx.Choice control on the Mac:
(1) EVT_SET_FOCUS and EVT_KILL_FOCUS aren’t triggered
(2) Tab traversal doesn’t work for wx.Choice controls. These controls are ignored altogether when moving from control to control
(3) If the initial value is set to -1 (which shows an un-initialized wx.Choice on Windows), on Mac it defaults to first item on list.

Maybe I’m overlooking some parameter or some method that needs to be initialized on the OSx platform?

These are the environments on which I’m running:
On the Mac: OS X 10.7.4, Python 2.7.3 , wxPython 2.9.4.0 osx-cocoa
On the PC: Windows 7 Home Basic, Python 2.7.2, wxPython 2.8.12.1

I can provide code if it would help.
Thanks for your help.

Hi.
I�m having trouble with code that works perfectly well on the Windows
platform but when moved to a Mac OS seems to break. Namely there are the
following issues with the wx.Choice control on the Mac:
(1) EVT_SET_FOCUS and EVT_KILL_FOCUS aren't triggered
(2) Tab traversal doesn't work for wx.Choice controls. These controls
are ignored altogether when moving from control to control

I think that there are already open bug reports about these, but also make sure that you have Full Keyboard Access set to All Controls in your Keyboard System Preferences.

(3) If the initial value is set to -1 (which shows an un-initialized
wx.Choice on Windows), on Mac it defaults to first item on list.

IIRC the native widget requires that a valid item be shown and there isn't a way around it. Instead you can just have " " as the first item in your list of choices.

···

On 10/14/12 10:59 PM, SRR wrote:

--
Robin Dunn
Software Craftsman

Robin:

Thanks for your answer. I tried your suggestion on changing the Keyboard System Preferences on the Mac and that almost works! Now the wx.Choice controls are available thru tab traversal and the SET_FOCUS/KILL_FOCUS events get triggered. The only problem is: The controls are arranged in a FlexGridSizer, and when the tab-traversing now does go into a wx.Choice control, the next tab will take it not to the next Tab-In-Order stop, but to whatever control happens to be to its right side in the sizer. Is this expected? On Windows the tab order just works fine.

As to the initial value having to be a valid choice, our applications requires knowledge of whether actual data has been input into the wx.Choice field. A value of -1 (valid according to “wxPython in Action”) indicates that data is still missing. I guess we’ll have to live with this issue on the Mac version. We’ll try to figure a work-around appplication-wise.

No, it should move the focus to the next widget in the tab order (which by default is the order they are created.)

···

On 10/17/12 5:24 PM, SRR wrote:

Robin:

Thanks for your answer. I tried your suggestion on changing the Keyboard
System Preferences on the Mac and that almost works! Now the wx.Choice
controls are available thru tab traversal and the SET_FOCUS/KILL_FOCUS
events get triggered. The only problem is: The controls are arranged in
a FlexGridSizer, and when the tab-traversing now does go into a
wx.Choice control, the next tab will take it not to the next
Tab-In-Order stop, but to whatever control happens to be to its right
side in the sizer. Is this expected? On Windows the tab order just works
fine.

--
Robin Dunn
Software Craftsman