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

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

New Here ,
Jul 11, 2023 Jul 11, 2023

Copy link to clipboard

Copied

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

Views

91
Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Report

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