Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Unknown macro: {alias}

Name

qinformation — information dialog

Syntax

qinformation caption text [button-0-text] [button-1-text] [button-2-text]

Description

The qinformation command displays a read-only message dialog with one or more buttons together with a caption. The default is a single 'OK' button. The dialog is modal therefore execution is halted until the user closes the dialog.

The dialog may optionally have up to three buttons to replace the default 'OK' button. The buttons are implicitly numbered 0, 1, 2. The command will return the number corresponding to the button pressed by the user.

Arguments

caption

text

button-x-text

Examples

Ex.1: Information dialog

      # A titled dialog with a message and OK button
      qinformation Information "Hello World"

The above example shows the simplest possible use of qinformation. The OK button is created automatically.

Ex.2: Information dialog with extra buttons

# Message with title and buttons. 
# Returns 0 (OK), 1 (Cancel), 2 (Details)
set button [qinformation "Open File" "The file was successfully opened" OK Cancel Details]
if { $button == 0 } {
   # OK button was pressed
} elseif { $button == 1 } {
   # Cancel buttons was pressed
} elseif { $button == 2 } {
   # Details buttons was pressed
}

Example #Information dialog with extra buttons shows a message dialog with a title and extra buttons. The number 0, 1, or 2 is returned to the program, depending on which button the user clicks.

  • No labels