TextCtrl focus events in wxWidgets

Frank Millman frank at chagford.com
Wed Jul 19 09:13:24 EDT 2006


David Hughes wrote:
>
> AIUI, wx.EVT_KILL_FOCUS is not a Command Event i.e. it doesn't
> propagate up the hierarchy of widgets until it gets handled, so it has
> to be bound explicitly to the control itself, as above.
>

Right.

This is one of the sources of confusion with events - which ones
'propagate up the hierarchy' and which ones do not.

This is a quote from the wxWidgets documentation -

"Typically events that deal with a window as a window (size, motion,
paint, mouse, keyboard, etc.) are sent only to the window. Events that
have a higher level of meaning and/or are generated by the window
itself, (button click, menu select, tree expand, etc.) are command
events and are sent up to the parent to see if it is interested in the
event."

Simon's first attempt would have been correct if EVT_KILL_FOCUS was
treated as a Command Event. Unfortunately, it is not, and therefore it
was not passed up to 'self' for handling.

Frank




More information about the Python-list mailing list