def insert_text_block(
        self,
        text_block_hint=(t.editing.objinsert.new_text_block),
        absolute_midtop=None,
    ):
        """Trigger text block insertion on graph manager.

        text_block_hint (
        graphman.textblock.main.TextBlock instance or string)

            if it is a string then we just insert a new
            text block using the given string and its text.

            if it is a TextBlock instance, then naturally
            no instantiation is needed, we just reinsert it.

        absolute_midtop (2-tuple or None)
            if not None, it is used as the relative midtop
            position of the text block being inserted.
        """
        ### assess whether the text_block_hint argument is
        ### a string or not, storing the result
        text_block_hint_is_str = isinstance(text_block_hint, str)

        ### if text_block_hint argument is a string
        ### gather spatial data and pass it to the
        ### graph manager so it can instantiate a new
        ### text block

        if text_block_hint_is_str:

            ## get absolute midtop coordinates according to
            ## whether it was provided via argument or not

            absolute_midtop = (
                absolute_midtop if absolute_midtop is not None else self.popup_spawn_pos
            )

            ## the relative midtop is obtained by taking
            ## into account the effect of the scrolling
            relative_midtop = tuple(absolute_midtop - self.scrolling_amount)

            ## gather id and spatial data in a dict which
            ## will be fed to the text block constructor

            text = text_block_hint

            text_block_data = {"text": text, "midtop": relative_midtop}

            ## create text block, adding its data file to
            ## the file

            APP_REFS.gm.create_text_block(
                text_block_data=text_block_data,
                text_block_absolute_midtop=absolute_midtop,
            )

        ### otherwise, we know it is a text block instance,
        ### so we instead just insert it
        else:
            APP_REFS.gm.insert_text_block(text_block=text_block_hint)

        ### indicate the data was changed
        indicate_unsaved()

        ### indicate birdseye view state of window manager must
        ### have its objects updated next time it is set
        APP_REFS.ea.must_update_birdseye_view_objects = True
Trigger text block insertion on graph manager.

        text_block_hint (
        graphman.textblock.main.TextBlock instance or string)

            if it is a string then we just insert a new
            text block using the given string and its text.

            if it is a TextBlock instance, then naturally
            no instantiation is needed, we just reinsert it.

        absolute_midtop (2-tuple or None)
            if not None, it is used as the relative midtop
            position of the text block being inserted.
        
nodezator/editing/objinsert.py