def __init__(self):
        """Set grid behaviour and related objects."""

        ### define grid-related behaviours

        ## create a grid drawing behaviour so it can be
        ## assigned to the grid_routine attribute
        ## whenever we want to draw the grid

        self.draw_grid = CallList()

        ## define and store a simple toggle for grid drawing
        ## behaviours

        # behaviours
        behaviours = (empty_function, self.draw_grid)

        # toggle

        self.toggle_grid = get_attribute_rotator(
            self,
            "grid_drawing_behaviour",
            behaviours,
        )

        ### set a control to keep track of scrolling amount
        self.scrolling_amount = Vector2()

        ### generate grid objects and also store the
        ### grid generation method as a window resize
        ### setup

        self.generate_grids()

        APP_REFS.window_resize_setups.append(self.generate_grids)
Set grid behaviour and related objects.
nodezator/editing/gridlogic.py