# IupAlarm

Definition: | include pGUI.e integer res = IupAlarm(string title, string msg, string b1, nullable_string b2=NULL, nullable_string b3=NULL)
Description: | Shows a modal dialog containing a message with at least one and up to three buttons (b1, b2, and b3).
pwa/p2js: | Not supported. See also the comments on IupMessage.
See Also: | IupMessage, IupMessageAlarm, IupMessageDlg, IupMessageError
Comments: | b1 is set as the "DEFAULTENTER". The "DEFAULTESC" is set to the last non-NULL of b1, b2, and b3. Returns 1, 2 or 3 to indicate which button was selected. Uses global attributes "PARENTDIALOG" and "ICON" if defined. Important: Almost all applications will benefit from IupSetAttributeHandle(NULL,"PARENTDIALOG",dlg). It can really help to explicitly control focus behaviour for IupAlarm() and the like, rather than rely on the often somewhat erratic default focus behaviour, especially on Windows.
Example: |
    include pGUI.e

        IupOpen()

        switch IupAlarm("Warning: file already esists","Overwrite file?","Yes","No")
            case 1: ?1 --(Yes clicked or return keyed) <code to overwite the file>
            case 2: ?2 --(No clicked or esc keyed)
            case 3: ?3 --(could happen if 3rd button specified (would also be esc))
            case 0: ?0 --(window closed (X clicked or Alt-F4 keyed))
            default: ?9/0 -- does not happen
        end switch

        IupClose()
See Also: | IupOpen, IupClose, IupMainLoop