Input/UI Dialogs
When your Final code runs inside final or final-gui, you can raise modal dialogs that pause the script until the user chooses Ok or Cancel.
These APIs live on the class-only type Dialog. The mechanisms used to build and show these dialogs are the same for both final and final-gui. (You do not need to know anything about Fyne and final-gui.)
There are three kinds:
| Kind | When to use | Entry |
|---|---|---|
| Prompt | Yes/no confirmation with a short message | Simple Prompt Dialogs |
| Ask | Collect a handful of string responses, using a simple API | Simple Ask Dialog |
| Field | Collect a handful of typed values (name, flag, number, …) using a more elaborated API than ask | Field Dialogs |
All three are blocking: the call does not return until the dialog closes. Esc (and Break / Ctrl-B) means Cancel. Only one dialog may be open at a time.
You already know the pieces these APIs lean on:
- Class methods with
^— Methods - Class constants such as
Dialog.btnOk— Properties - fields DynamicObjects for Field Dialogs — DynamicObject
- The modal result shape
( … -- result true \| false )for Field Dialog Ok vs Cancel — Writing Clean Final Code
The next two pages cover the exact stack effects, parameters, and short worked examples.