Utility functions / Common dialog utility functions (IMPORT FGL fgldialog) |
Displays an interactive message box containing multiple choices, in a popup window.
fgl_winbutton( title STRING, text STRING, default STRING, buttons STRING, icon STRING, danger SMALLINT ) RETURNING result STRING
Use the fgl_winbutton() function to open a message box and let the end user select an option in a set of buttons. The function returns the label of the button which has been selected by the user.
Use '\n' in text to separate lines (this does not work in TUI mode).
Supported names for the icon parameter are: information, exclamation, question, stop.
You can define up to 7 buttons that each have 10 characters.
If two buttons start with the same letter, the user will not be able to select one of them in the TUI mode.
The "&" before a letter for a button is displayed in TUI mode, or underlines the next letter in graphical front-ends.
This function is provided for backward compatibility, use a menu with "dialog" style instead.
IMPORT FGL fgldialog MAIN DEFINE answer STRING LET answer = fgl_winbutton( "Media selection", "What is your favorite media?", "Lynx", "Floppy Disk|CD-ROM|DVD-ROM|Other", "question", 0) DISPLAY "Selected media is: " || answer END MAIN