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


        config["check_spelling"] = str(event.IsChecked())
        toggle_id = self.parent.menubar.FindMenuItem(_("View"),
                                                     _("Check spelling"))
        if toggle_id != -1:
            # Check may fail if translation is incomplete
            toggle_item = self.parent.menubar.FindItemById(toggle_id)
            toggle_item.Check(event.IsChecked())

        self.parent.grid.grid_renderer.cell_cache.clear()
        self.parent.grid.ForceRefresh()

        event.Skip()