Help home › Introduction to Lua › Create User Interfaces with IUP › iup.Alarm

IUP

iup.Alarm

Description

Shows message box, with a number of buttons. It returns the number of the button pressed.  Up to 3 buttons can be used.

Syntax

iButton = iup.Alarm(strTitle,strMessage,strbutton1[,strbutton2[,strbutton3]])

Parameters

strTitle
string: title for the message box
strMessage
string: text to appear in message box. \n can be used to split the lines of the message.
strButton
string: title of the button. Any number of buttons can be defined.

Returns

iButton
integer: number of the button pressed.

Example

b = iup.Alarm("iupAlarm Example", "File not saved! Save it now?" ,"Yes" ,"No" ,"Cancel")
 
-- Shows a message for each selected button
if b == 1 then
   iup.Message("Save file", "File saved successfully - leaving script")
elseif b == 2 then
   iup.Message("Save file", "File not saved - leaving script anyway")
elseif b == 3 then
   iup.Message("Save file", "Operation cancelled")
end