code: def OnSpellCheckToggle(self, event):
          
  
          spelltoolid = self.main_window.main_toolbar.label2id["CheckSpelling"]
          self.main_window.main_toolbar.ToggleTool(spelltoolid,
                                                   not config["check_spelling"])
  
          config["check_spelling"] = repr(not config["check_spelling"])
  
          self.main_window.grid.grid_renderer.cell_cache.clear()
          self.main_window.grid.ForceRefresh()
docs: Spell checking toggle event handler