Pete,
How about.
Create a window for example MyWindow
In the code of the button or mousclick
Open(MyWindow, MouseXPos(),MouseYPos())
or for popup window
Openpopup(MyWindow, MouseXPos(),MouseYPos())
Set the (popup)window to be not visible
in global procedure
PROCEDURE MYWindow(XPos is int, YPos is int)
In the initialisation procedure
Myself..X = XPos
Myself..Y = YPos
Myself..Visible = True
The not visible setting and Myself..visible is a cosmetic process. When you will not do this, you will see the window in its original position first and then in the position of the mouse. I don't like this, so i set the window to not visible and set it to visible after the new position.
Cheers,
Carlo