Floating WIndows

I have an app with one main window (DOCUMENT) and 3 floating windows… all of which are visible at the same time

However, if the user clicks on ANOTHER application… the main window “vanishes” (or more accuratly moves to below the other apps now active window)
but the floating windows remain on top of everything…

What I need to do is, when another app is selected, have the floating windows “hide”, and when my app is re-selected have them appear again
But I can’t find an event that indicates this… I can’t use “focus” as clicking on my floats removes focus from the main window also.

What about app.activate and app.deactivate?

yup… just tried that…

in DEACTIVATE I put

winXYZ.hide

and in ACTIVATE i put

winXYZ.SHOW

and now the window never shows at all… EVER

XYZ would ultimatly be all 3 windows… just trying one for now…

but this doesn’t seem to work (and yes the APP events Are beling called at the times I expect)

Solution.
I had to put the HIDE in APP.DEACTIVATE
but the SHOW had to go in MAINWINDOW.ACTIVATE … NOT in App.Activate

not sure why… but it seems to work