Close/Open Window Event Order

I’ve got a docked window that only needs to be open when certain main windows are opened, otherwise the docked window should be closed.

The problem happens when navigating between windows where each require the docked window to be open. An event that detects the closing of the first window does close the docked window, but the open event on the new window does not re-open the docked window.

I’ve tried using the various visionWindow and frame events to open and close the docked when loading the desired window, but there seems to be no magic combination.

What is the order of events? Should I be able to accomplish this using only events on the required main windows?

I would open the dock unconditionally in both windows’s open and activated events. I would define a projects script that attempts to .getWindow() on both main windows, and if either succeeds, return without doing anything. If neither is open, close the dock. Use that project script with invokeLater and a 100ms delay in each main window’s close events.

1 Like

Thanks Phil. That works but it’s kind of clunky with the screen resizing on a window that doesn’t require the docked window. Now it feels like a better solution might be to always have the docked window, and be empty if there’s nothing on it.

I’m creating a operational data display dash board with a template repeater driven by a dataset of tag paths, and it might not make sense for all screens (e.g. alarms, roster/user management, etc.)

Thanks anyway!