code: def insert_before(self, target):
          
          if not target.parent:
              return
          target.parent.insert(target.parent.sprites.index(target), self)
docs: insert this widget into the targets parent before the target