Setting properties in a visionWindowOpened event has no effect

I have a popup window with a label. The window receives a single custom property, so I open it as follows:

window = system.nav.openWindow(“popup_window”, {“param”: 123})
system.nav.centerWindow(window)

In the popup window, I have this code running in the visionWindowOpened event handler:

root_container = system.gui.getParentWindow(event).getComponentForPath(‘Root Container’)
label = system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Label’)

label.text = str(root_container.param)

So the issue here is that when the popup appears, the label does not show “123” as its text.
I know I could bind the label text directly to the window custom property, but I’m trying to understand why this specific way of doing things is not working.

UPDATE: it does work when launching the project, but it doesn’t work as expected when running in designer.

visionWindowOpened and Closed events do not fire in the designer.

2 Likes