How to get a component's xy attributes on an xypanel

How about a function that

  1. Adds the component to the XYPanel, and
  2. Logs the coordinates in a dict? For later reference.