IupMessageDlg

IUP - Portable User Interface

IupMessageDlg

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 dialog, or NULL if an error occurs.

Attributes

TITLE: Dialog title.

VALUE: Message text.

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".

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.

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".

PARENTDIALOG: (Creation Only) Name of a dialog to be used as parent. This dialog will be always in front of the parent dialog.

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 IupMessage function simply creates and popup a IupMessageDlg.

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

Examples

  Ihandle* dlg = IupMessageDlg();
  IupSetAttribute(dlg, "DIALOGTYPE", "WARNING");
  IupSetAttribute(dlg, "TITLE", "Dialog Title");
  IupSetAttribute(dlg, "BUTTONS", "OKCANCEL");
  IupSetAttribute(dlg, "VALUE", "Message Text\nSecond Line");
  IupPopup(dlg, IUP_CENTER, IUP_CENTER);
  printf("BUTTONRESPONSE(%s)\n", IupGetAttribute(dlg, "BUTTONRESPONSE"));
  IupDestroy(dlg);
  
Windows XP Motif/Mwm GTK/GNOME

See Also

IupMessage, IupScanf, IupListDialog, IupAlarm, IupGetFile, IupPopup