def on_close_grid(self, event):
        """
        If there is an open grid, save its data and close it.
        """
        if self.parent.grid_frame:
            self.parent.grid_frame.onSave(None)
            self.parent.grid_frame.Destroy()
def on_close_grid ( self , event ) : if self . parent . grid_frame : self . parent . grid_frame . onSave ( None ) self . parent . grid_frame . Destroy ( )
If there is an open grid, save its data and close it.