code: def on_menu(self, event):
          '''called on menu event'''
          state = self.state
          if self.popup_menu is not None:
              ret = self.popup_menu.find_selected(event)
              if ret is not None:
                  ret.popup_pos = self.popup_pos
                  if ret.returnkey == 'fitWindow':
                      self.fit_to_window()
                  elif ret.returnkey == 'fullSize':
                      self.full_size()
                  else:
                      state.out_queue.put(ret)
                  return
          if self.menu is not None:
              ret = self.menu.find_selected(event)
              if ret is not None:
                  state.out_queue.put(ret)
                  returf on_menu(self, event):
          '''called on menu event'''
          state = self.state
          if self.popup_menu is not None:
              ret = self.popup_menu.find_selected(event)
              if ret is not None:
                  ret.popup_pos = self.popup_pos
                  if ret.returnkey == 'fitWindow':
                      self.fit_to_window()
                  elif ret.returnkey == 'fullSize':
                      self.full_size()
                  else:
                      state.out_queue.put(ret)
                  return
          if self.menu is not None:
              ret = self.menu.find_selected(event)
              if ret is not None:
                  state.out_queue.put(ret)
                  return
docs: called on menu event