In order to give good visual feedback to the users of an application, the user interface should let the user know when they can and cannot interact with an action that is provided by the interface. Managing the state of when a ToolBar
or MenuItem
object can be executed may quickly become a difficult and messy task if it is necessary to monitor and update an action in response to each and every action the user may take when using the UI. Fortunately, the EVT_UPDATE_UI
event is provided to give the application an easy way to update the state of UI elements periodically during its idle time.
This recipe builds on the previous recipe in this chapter, Working with ToolBars, in order to show how to use EVT_UPDATE_UI
to manage the state of toolbar icons.