Dismiss dialog by clicking outside

Hi, I’m looking for some behaviour where I want to pop up a window and have it essentially modal, but be able o register a click outside the window in order to dismiss it.

Anyone any tips on how to achieve?

thx

How about Component::focusLost()?

or TopLevelWindow::activeWindowStatusChanged()?

focusLost() is no good as the window is modal so the click is getting blocked somewhere…

Override mouseDown and check if the modal component contains the point - I’ve done something similar in the app I’m currently working on.

hi, tried that but mouseDown() is also not being called.

Perhaps

Component::inputAttemptWhenModal()

is what you are looking for?

1 Like

perfect, thanks!

1 Like