<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnSpellCheckToggle(self, event):
 """Spell checking toggle event handler"""


        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()