Skip to main content
Participant
July 11, 2023
Question

SDK: LR Plugin - How to notify before closing a window in lua?

  • July 11, 2023
  • 1 reply
  • 122 views

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.

 

 

This topic has been closed for replies.

1 reply

johnrellis
Legend
July 11, 2023

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.