Grid shape change event handler, marks content as changed

def change_grid_shape(self, shape):
        """Grid shape change event handler, marks content as changed"""

        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        self.code_array.shape = shape

        # Update TableChoiceIntCtrl
        post_command_event(self.main_window, self.ResizeGridMsg, shape=shape)

        # Change grid table dimensions
        self.grid.GetTable().ResetView()

        # Clear caches
        self.code_array.result_cache.clear()