code: def OnSearchFlag(self, event):
          
  
          for label in self.search_options_buttons:
              button_id = self.label2id[label]
              if button_id == event.GetId():
                  if event.IsChecked():
                      self.search_options.append(label)
                  else:
                      flag_index = self.search_options.index(label)
                      self.search_options.pop(flag_index)
  
          event.Skip()
docs: Event handler for search flag toggle buttons