fgl_winbutton()

Displays an interactive message box containing multiple choices, in a pop-up window.

Syntax

fgl_winbutton(
   title STRING,
   text STRING,
   default STRING,
   buttons STRING,
   icon STRING,
   danger SMALLINT )
  RETURNS STRING
  1. title defines the title of the message window.
  2. text specifies the string displayed in message window.
  3. default indicates the default button to be pre-selected.
  4. buttons defines a set of button labels separated by "|".
  5. icon is the name of the icon to be displayed.
  6. danger (for X11 only), number of warning items. Otherwise, this parameter is ignored.

Usage

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.

Example

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