wxRuby Documentation Home

# Wx::MessageDialog

This class represents a dialog that shows a single or multi-line message,
with a choice of OK, Yes, No and Cancel buttons.

## Derived from

Dialog

Window

EvtHandler

Object

## See also

MessageDialog overview

## Methods

- MessageDialog.new
- MessageDialog#show_modal

### MessageDialog.new

MessageDialog.new(%(arg-type)Window% parent, String message, String caption = “Message box”, Integer style = OK CANCEL, Point pos = DEFAULT_POSITION)

Constructor. Use MessageDialog#show_modal to show the dialog.

#### Parameters

- parent Parent window.
- message Message to show on the dialog.
- caption The dialog caption.
- style A dialog style (bitlist) containing flags chosen from the following:

OK | Show an OK button.
CANCEL | Show a Cancel button.
YES_NO | Show Yes and No buttons.
YES_DEFAULT | Used with YES_NO, makes Yes button the default – which is the default behaviour.
NO_DEFAULT | Used with YES_NO, makes No button the default.
ICON_EXCLAMATION | Shows an exclamation mark icon.
ICON_HAND | Shows an error icon.
ICON_ERROR | Shows an error icon – the same as ICON_HAND.
ICON_QUESTION | Shows a question mark icon.
ICON_INFORMATION | Shows an information (i) icon.
STAY_ON_TOP | The message box stays on top of all other window, even those of the other applications (Windows only).

- pos Dialog position. Not Windows.

destructor()

Destructor.

### MessageDialog#show_modal

Integer show_modal()

Shows the dialog, returning one of ID_OK, ID_CANCEL, ID_YES, ID_NO.

[This page automatically generated from the Textile source at 2023-06-09 00:45:27 +0000]