code: def add_object(self, obj):
          '''add an object to a later'''
          state = self.state
          if not obj.layer in state.layers:
              # its a new layer
              state.layers[obj.layer] = {}
          state.layers[obj.layer][obj.key] = obj
          state.need_redraw = Truf add_object(self, obj):
          '''add an object to a later'''
          state = self.state
          if not obj.layer in state.layers:
              # its a new layer
              state.layers[obj.layer] = {}
          state.layers[obj.layer][obj.key] = obj
          state.need_redraw = True
docs: add an object to a later