Setting pop up location dynamically

Is this a possible function? I know that you can hard set a pop up location, but I am trying to have values moved in dynamically based on three different locations on the screen. each button would open the same window with different parameters in a different location.

thank you

Hi mpeasley,

You should add custom properties to the root container of the popup window. The custom properties will hold the X and Y position you want to position the popup window at.

Each of your buttons should pass in as arguments to the window the position you want the window to be at. The window receives the arguments into the root container custom properties that you made and uses them to position the window. You can set the position of a window in a Python script with window.setLocation(x,y). Try putting the script into the visionWindowOpened event handler on the popup window. Or in a propertyChange event handler on the root container for when the X or Y property changes.

Best,

3 Likes

what is the script for changing the width and height of window without scaling?
I test window.setSize(W,H) but it scale the window. I want to expand window not scale it.

1 Like

You need to set the Layout of the components in the window to Anchored. Each of them.

1 Like