Unit 'intuition' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

DisplayAlert

Create the display of an alert message.

Declaration

Source position: intuition.pas line 3816

function DisplayAlert(

  AlertNumber: LongWord;

  const String_: PChar;

  Height: LongWord

):LongBool;

Arguments

AlertNumber

  

The number of this alert message. The only pertinent bits of this number are the ALERT_TYPE bit(s). The rest of the number is ignored by this routine.

String_

  

A pointer to the alert message string, as described above

Height

  

Minimum display lines required for your message

Function result

A LongBool value of True or False. If this is a DEADEND_ALERT, False is always the return value. If this is a RECOVERY_ALERT. The return value will be True if the user presses the left mouse button in response to your message, and False if the user presses the right hand button is response to your text, or if the alert could not be posted.

Description

Creates an alert display with the specified message.

If the system can recover from this alert, it's a RECOVERY_ALERT and this routine waits until the user presses one of the mouse buttons, after which the display is restored to its original state and a LongBool value is returned by this routine to specify whether or not the user pressed the Left mouse button.

If the system cannot recover from this alert, it's a DEADEND_ALERT and this routine returns immediately upon creating the alert display. The return value is False.

NOTE: If Intuition can't get enough memory for a RECOVERY_ALERT, the value False will be returned.

AlertNumber is a LongInt value, historically related to the value sent to the Alert() routine. But the only bits that are pertinent to this routine are the ALERT_TYPE bit(s). These bits must be set to either RECOVERY_ALERT for alerts from which the system may safely recover, or DEADEND_ALERT for those fatal alerts. These states are described in the paragraph above. There is a third type of alert, the DAISY_ALERT, which is used only by the Exec.

The String_ argument points to an AlertMessage string. The AlertMessage string is comprised of one or more substrings, each of which is composed of the following components:

The last argument, Height, describes how many video lines tall you want the alert display to be.

Alerts are always rendered in Topaz 8 (80 column font), regardless of the system default font. Also, RECOVERY_ALERTs are displayed in amber, while DEADEND_ALERTs are still red. Alerts no longer push down the application screens to be displayed. Rather, they appear alone in a black display.

Alerts block each other out, and input during an alert is deprived of the rest of the system. Internal input buffers still cause alert clicks to be processed by applications sometimes.

Errors

This function is obsolete and exists only for backwards compatibility with AmigaOS(tm). On various modern systems this function has different effects. On classic Amiga(tm) this function may not work with RTG displays, so it is generally deprecated. Please don't use it in a new software! Use legitimate intuition requesters if you want to present some message to the user.

See also

TimedDisplayAlert

  

Display an alert with automatic time-out.


Documentation generated on: 2021-07-30