Copy link to clipboard
Copied
I would like when the user presses one of these three buttons to notify you that you want to close this window, how to code this? I am currently using lua to write plugins.
Copy link to clipboard
Copied
If you want to ask the user if they really want to close the window and give them an option to cancel the closing, you can't do that with a modal dialog (LrDialogs.presentModalDialog). You'll know after the fact that the user has closed the window, when presentModalDialog() returns.
You could use a floating dialog (LrDialogs.presentFloatingDialog), which doesn't provide any built-in buttons, and you'd implement your own OK and Cancel buttons. But there's no way to intervene when the user clicks the "x" in the corner -- you'll just get notified after the dialog closes.