← Back to team overview

kicad-developers team mailing list archive

wxUpdateUIEvent abuse


Given the recent rash of odd dialog UI behavior, I did some digging and
it appears that we might be abusing wxUpdateUIEvent[1].  This event
handler was specifically designed for updating controls that respond to
command events such as menus, toolbars, buttons, etc.  Using them for
anything else is risky.  I would avoid using UI control object calls
inside a wxUpdaetUIEvent handler other than those provided by the
wxUpdateUIEvent object itself.  I'm pretty sure making changes to a
control inside a wxUpdateUIEvent handler can spawn an event loop where
the changes made to the control generate a new wxUpdateUIEvent.  A
better solution might be to use wxIdleEvent to do any dialog control
post processing as a one shot.




Follow ups