I add this MenuHandler in App:
Function FileClose() As Boolean
// ********** ********** ********** **********
//
// Close the Front Window (if there is one)
//
If WindowCount > 0 Then
// Close the current Front Window
Window(0).Close
End If
Return True
End Function
And it closed the PopOver window AND its Owner’s window…
Gemini is on the garden…
Ideas ?
You’re going to have a bad time trying to implement a generic handler like this. You close a popover using Self.Window.Close where Self is the popover container. To find a popover window in the stack, you’ll need to test some values of each window. You can’t assume it is window zero. I’m not sure which properties will be different for the popover window, or if it shows in the window stack at all.
Also, you should consider checking to make sure the window is closeable before allowing the menu handler to close it. Normally I prefer to implement this logic in a window subclass, not generally.
Thank you Thom.
Funny: I had a data read error in the PopOver, so I made a screen shot to remember it and I get the PopOver AND the owner’s window (behind) using macOS "Copy window: cmd-4-Click).
So, I can change my UI and add a Close button (I was thinking at a MouseDown Click to close, but an error is so easy to do using that… I closed the idea).
NB: a click in the owner’s window close the PopOver…
Your advice ?
PS: I was surprised by the behavior, but the window is a viewer (nothing is created = nothing can be lost. Just need to select another time a folder…