IupMessageDlg

IUP - Portable User Interface

IupMessageDlg (since 3.0)

Creates the Message Dialog element. It is a predefined dialog for displaying a message. The dialog can be shown with the IupPopup function only.

Creation

Ihandle* IupMessageDlg(void); [in C]
iup.messagedlg() -> (elem: ihandle) [in Lua]
messagedlg() [in LED]

Returns: the identifier of the created element, or NULL if an error occurs.

Attributes

BUTTONDEFAULT: Number of the default button. Can be "1" or "2". "2" is valid only for "OKCANCEL" and "YESNO" button configurations.

BUTTONRESPONSE: Number of the pressed button. Can be "1" or "2".

BUTTONS: Buttons configuration.

Can have values: "OK", "OKCANCEL" or "YESNO". Default: "OK".

Addicionally the "Help" button is diplayed if the HELP_CB callback is defined.

DIALOGTYPE: Type of dialog defines which icon will be displayed besides the message text.

Can have values: "MESSAGE" (No Icon), "ERROR" (Stop-sign), "WARNING" (Exclamation-point), "QUESTION" (Question-mark)  or "INFORMATION" (Letter "i"). Default: "MESSAGE".

PARENTDIALOG: (Creation Only) Name of a dialog to be used as parent. This dialog will be always in front of the parent dialog. If not defined in Motif the dialog could not be modal.

TITLE: Dialog title.

VALUE: Message text.

Callbacks

HELP_CB: Action generated when the Help button is pressed.

Notes

The IupMessageDlg is a native pre-defined dialog not altered by IupSetLanguage.

To show the dialog, use function IupPopup. In Lua, use the popup function.

The dialog is mapped only inside IupPopup, IupMap does nothing.

In Windows the position (x,y) used in IupPopup is ignored and the dialog is always centered on screen.

The IupMessage function simply creates and popup a IupMessageDlg.

In Windows each different dialog type is always associated with a different beep sound.

Examples

Ihandle* dlg = IupMessageDlg();

IupSetAttribute(dlg, "DIALOGTYPE", "WARNING");
IupSetAttribute(dlg, "TITLE", "IupMessageDlg Test");
IupSetAttribute(dlg, "BUTTONS", "OKCANCEL");
IupSetAttribute(dlg, "VALUE", "Message Text\nSecond Line");
IupSetCallback(dlg, "HELP_CB", (Icallback)help_cb);

IupPopup(dlg, IUP_CURRENT, IUP_CURRENT);

printf("BUTTONRESPONSE(%s)\n", IupGetAttribute(dlg, "BUTTONRESPONSE"));

IupDestroy(dlg);  
Windows XP Motif/Mwm GTK/GNOME

See Also

IupMessage, IupScanf, IupListDialog, IupAlarm, IupGetFile, IupPopup