Show a message box
To display a message box to the user, use the MessageBox
function. This function takes an object with a title, message and others. Here's the properties you'll have to specify:
title
: the title of the message boxmessage
: the message below the titlebuttons
: an array ofMessageBoxButtons
(see below)image
: the path to an image to display (optional).sound
: a sound ID to play using the SoundBus kernel module
Besides the initial object, you specify two other arguments, the first being the parent PID, and the second deciding if the dialog is displayed as an overlay (or modal) on top of the parent. Here's the type of the MessageBox function and its interfaces:
Message box buttons
A button object has its own set of properties. Here they are:
caption
: the text to display on the buttonaction
: a function to call when the button is clicked. This callback can safely be asynchronous if necessary: ArcOS will await it.suggested
: set it to true to make the button suggested (bold and accented)
ArcOS Sounds
These sounds can be used in the sound
property of a message box:
arcos.dialog.error
- Error sound,arcos.dialog.warning
- Warning sound,arcos.dialog.info
- Info sound,arcos.notification
- The ArcOS notification sound,arcos.system.logoff
- Logoff sound,arcos.system.logon
- Login sound,arcos.click
- Navigation sound — not used anywhere in v7
Examples
Last updated