[wxPython-dev] strange event IDs for SET_FOCUS and KILL_FOCUS wx2.6 Grid

Chris Mellon arkanes at gmail.com
Fri Jan 12 05:35:25 PST 2007


On 1/12/07, Niki Spahiev <niki at vintech.bg> wrote:
> Chris Mellon wrote:
> > On 1/11/07, Niki Spahiev <niki at vintech.bg> wrote:
> >> Robin Dunn wrote:
> >> > Niki Spahiev wrote:
> >> >> Hello,
> >> >>
> >> >> Attached program demonstrates anomaly in focus events. Under wx 2.4
> >> >> focus events report top grid window as requested. Under wx 2.6 inner
> >> >> window is reported (name=grid window).
> >> >
> >> > The gridWindow is actually the one that has the focus at all times,
> >> > except when an editor is active, so it is the one that receives the
> >> > events.  It has a handler function that just forwards the event to the
> >> > wxGrid so your bindings will get the event too.
> >>
> >> I added event.Skip() to focus handler but got nothing. How should i
> >> change this sample to get real grid ID?
> >>
> >> There is no problem in wx 2.4. This looks like bug in wx-2.6 and 2.8
> >>
> >
> > It's not a bug, it's reporting the ID of the window with the focus, as
> > it should. The window with the focus is a subchild of the wxGrid.
>
> Yes i know that, but handler is registered for wxGird focus not for its
> children. Proper behavior is to get event about registered ID and window.
>
> regards,
>
> Niki Spahiev

wxGrid per se never gets focus. It escalates focus events that the
internal windows that make up the control get. Proper behavior is for
the event ID to be the window that actually receives focus.




More information about the wxpython-dev mailing list