code: def OnPreferences(self, event):
          
  
          preferences = self.interfaces.get_preferences_from_user()
  
          if preferences:
              for key in preferences:
                  if type(config[key]) in (type(u""), type("")):
                      config[key] = preferences[key]
                  else:
                      config[key] = ast.literal_eval(preferences[key])
  
          self.main_window.grid.grid_renderer.cell_cache.clear()
          self.main_window.grid.ForceRefresh()
docs: Preferences event handler that launches preferences dialog