wx.Choice / no focus events?

wx.Choice doesn't seem to report getting/losing the focus, even though I can use the keyboard to tab to the control.

In addition, when I select an item in a wx.Choice, the next control will emit a SET_FOCUS even though I never left the wx.Choice: all I did was set the selection.

See the attached file.

wxPython 2.5.3.1 / gtk2

cho.py (520 Bytes)

···

--
Paul McNett
http://paulmcnett.com

wx.Choice doesn't seem to report getting/losing the focus, even though I
can use the keyboard to tab to the control.

In addition, when I select an item in a wx.Choice, the next control will
emit a SET_FOCUS even though I never left the wx.Choice: all I did was
set the selection.

See the attached file.

wxPython 2.5.3.1 / gtk2

If you put the controls inside a wx.Panel rather than directly in the
frame, things get better: if you tab to the choice, it gets the focus
correctly, and it keeps it even after changing the selection. However, it's
still true that if the text control has the focus, changing the selection
of the choice with the mouse doesn't cause a change of focus to that
control... can this be considered a bug?

Alberto

Paul McNett wrote:

wx.Choice doesn't seem to report getting/losing the focus, even though I can use the keyboard to tab to the control.

In addition, when I select an item in a wx.Choice, the next control will emit a SET_FOCUS even though I never left the wx.Choice: all I did was set the selection.

Please enter a bug report (category == "wxGTK specific") about these issues.

···

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

[sending it again, because it seems it didn't arrive...]

wx.Choice doesn't seem to report getting/losing the focus, even though I
can use the keyboard to tab to the control.

In addition, when I select an item in a wx.Choice, the next control will
emit a SET_FOCUS even though I never left the wx.Choice: all I did was
set the selection.

See the attached file.

wxPython 2.5.3.1 / gtk2

If you put the controls inside a wx.Panel rather than directly in the
frame, things get better: if you tab to the choice, it gets the focus
correctly, and it keeps it even after changing the selection. However, it's
still true that if the text control has the focus, changing the selection
of the choice with the mouse doesn't cause a change of focus to that
control... can this be considered a bug?

Alberto

Alberto Griggio wrote:

[sending it again, because it seems it didn't arrive...]

Yes it did arrive, BTW.

If you put the controls inside a wx.Panel rather than directly in the
frame, things get better: if you tab to the choice, it gets the focus
correctly, and it keeps it even after changing the selection. However, it's
still true that if the text control has the focus, changing the selection
of the choice with the mouse doesn't cause a change of focus to that
control... can this be considered a bug?

Robin considers it a bug, and asked me to file a bug report on it, which I haven't gotten around to yet.

I should have put my test inside a panel, because I don't think that if you tab to it and tab away from it that the focus events will fire. At least that was my initial observation in running code that prompted me to make a small test case.

···

--
Paul McNett
http://paulmcnett.com