Dynamic Popup Positioning

Hi,

Running a script on click to open a popup window.

The clicked component is located within a template, which is placed in a window.

event.getY() gives me where I click within the component itself
event.source.getY() gives me 0 - not handy
event.source.parent.getY() gives me 0 - not handy
event.source.getLocationOnScreen().y gives me the vertical position from the top of the screen, although my application is a window, somewhere on that screen.

questions

  1. how to I find the Y position of the current window
  2. how do I find the Y position of the template, which contains the clicked component

Thanks

Tim

Here you go:

To get the Y position of the current window:

print system.gui.getParentWindow(event).y

To get the Y position of the template:

print event.source.parent.parent.y