Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Jul 11, 2023 Jul 11, 2023

Ryuza275806522p8s_0-1689083817125.png

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.

 

 

TOPICS
macOS , SDK , Windows
93
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 11, 2023 Jul 11, 2023
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines