parameters: (self, event)
docstring: Handles the ``wx.EVT_IDLE`` event for :class:`FlatMenuBar`.
  
          :param `event`: a :class:`IdleEvent` event to be processed.
docstring_summary: Handles the ``wx.EVT_IDLE`` event for :class:`FlatMenuBar`.
docstring_tokens: Handles the wx . EVT_IDLE event for : class : FlatMenuBar .
function: def OnIdle(self, event):
          """
          Handles the ``wx.EVT_IDLE`` event for :class:`FlatMenuBar`.
  
          :param `event`: a :class:`IdleEvent` event to be processed.
          """
  
          refresh = False
          
          if self._watch.Time() > self._interval:
          
              # it is time to process UpdateUIEvents
              for but in self._tbButtons:
                  event = wx.UpdateUIEvent(but._tbItem.GetId())
                  event.Enable(but._tbItem.IsEnabled())
                  event.SetText(but._tbItem.GetLabel())
                  event.SetEventObject(self)
  
                  self.GetEventHandler().ProcessEvent(event)
  
                  if but._tbItem.GetLabel() != event.GetText() or but._tbItem.IsEnabled() != event.GetEnabled():
                      refresh = True
  
                  but._tbItem.SetLabel(event.GetText())
                  but._tbItem.Enable(event.GetEnabled())
              
              self._watch.Start() # Reset the timer
          
          # we need to update the menu bar
          if refresh:
              self.Refresh()
function_tokens: def OnIdle ( self , event ) : refresh = False if self . _watch . Time ( ) > self . _interval : # it is time to process UpdateUIEvents for but in self . _tbButtons : event = wx . UpdateUIEvent ( but . _tbItem . GetId ( ) ) event . Enable ( but . _tbItem . IsEnabled ( ) ) event . SetText ( but . _tbItem . GetLabel ( ) ) event . SetEventObject ( self ) self . GetEventHandler ( ) . ProcessEvent ( event ) if but . _tbItem . GetLabel ( ) != event . GetText ( ) or but . _tbItem . IsEnabled ( ) != event . GetEnabled ( ) : refresh = True but . _tbItem . SetLabel ( event . GetText ( ) ) but . _tbItem . Enable ( event . GetEnabled ( ) ) self . _watch . Start ( ) # Reset the timer # we need to update the menu bar if refresh : self . Refresh ( )