code: def toggle_codes(self, event):
          
          btn = event.GetEventObject()
          if btn.Label == 'Show method codes':
              self.code_msg_boxsizer.ShowItems(True)
              btn.SetLabel('Hide method codes')
          else:
              self.code_msg_boxsizer.ShowItems(False)
              btn.SetLabel('Show method codes')
          self.do_fit(None)
docs: Show/hide method code explanation widget on button click