def __init__(self):
        """Reference itself in the node class."""
        ### reference itself on APP_REFS
        APP_REFS.gm = self

        ### create rect to mark origin of 2d space
        self.origin_rect = Rect(0, 0, 100, 100)

        ### create special lists to hold viewer objects

        self.preview_toolbars = List2D()
        self.preview_panels = List2D()

        ### special object to manage rects of all objects
        ### in the graph;
        ###
        ### manipulating this instance when the graph is empty
        ### raises a RuntimeError, so always check this condition
        ### before doing so
        self.rectsman = RectsManager(self.yield_all_rects)

        ### list for temporarily storing references to nodes
        ### on screen
        self.nodes_on_screen = []

        ### make sure socket detection graphics are in place
        self.reference_socket_detection_graphics()

        ### initialize each base class which has its own
        ### init method
        initialize_bases(self)
Reference itself in the node class.
nodezator/graphman/main.py