code: def change_frozen_attr(self):
          
  
          # Selections are not supported
  
          if self.grid.selection:
              statustext = _("Freezing selections is not supported.")
              post_command_event(self.main_window, self.StatusBarMsg,
                                 text=statustext)
  
          cursor = self.grid.actions.cursor
  
          frozen = self.grid.code_array.cell_attributes[cursor]["frozen"]
  
          if frozen:
              # We have an frozen cell that has to be unfrozen
  
              # Delete frozen cache content
              self.grid.code_array.frozen_cache.pop(repr(cursor))
  
          else:
              # We have an non-frozen cell that has to be frozen
  
              # Add frozen cache content
              res_obj = self.grid.code_array[cursor]
              self.grid.code_array.frozen_cache[repr(cursor)] = res_obj
  
          # Set the new frozen state / code
          selection = Selection([], [], [], [], [cursor[:2]])
          self.set_attr("frozen", not frozen, selection=selection)
docs: Changes frozen state of cell if there is no selection