enaml.stdlib.message_box

Functions

about

Display a simple about box with title and text.

critical

Display an critical message box with title and text.

information

Display an information message box with title and text.

question

Display a question message box with title and text.

warning

Display a warning message box with title and text.

Classes

MessageBox

A dialog which provides the functionality of a message box.

enaml.stdlib.message_box.about(parent, title, text)

Display a simple about box with title and text.

Parameters
  • parent (Widget or None) – The Enaml widget which should be the parent of the dialog.

  • title (str) – The text for the window title bar.

  • text (str) – The main text to display in the dialog.

enaml.stdlib.message_box.critical(parent, title, text, buttons=None)

Display an critical message box with title and text.

On Windows, the dialog will display the stock critical icon.

Parameters
  • parent (Widget or None) – The Enaml widget which should be the parent of the dialog.

  • title (str) – The text for the window title bar.

  • buttons (list, optional) – The list of DialogButton instances to display in the dialog. If this is not provided, an ‘OK’ button will be created.

Returns

result – The dialog button object which was clicked, or None if the dialog was closed without clicking a dialog button.

Return type

DialogButton or None

enaml.stdlib.message_box.information(parent, title, text, buttons=None)

Display an information message box with title and text.

On Windows, the dialog will display the stock information icon.

Parameters
  • parent (Widget or None) – The Enaml widget which should be the parent of the dialog.

  • title (str) – The text for the window title bar.

  • buttons (list, optional) – The list of DialogButton instances to display in the dialog. If this is not provided, an ‘OK’ button will be created.

Returns

result – The dialog button object which was clicked, or None if the dialog was closed without clicking a dialog button.

Return type

DialogButton or None

enaml.stdlib.message_box.question(parent, title, text, buttons=None)

Display a question message box with title and text.

On Windows, the dialog will display the stock question icon.

Parameters
  • parent (Widget or None) – The Enaml widget which should be the parent of the dialog.

  • title (str) – The text for the window title bar.

  • buttons (list, optional) – The list of DialogButton instances to display in the dialog. If this is not provided, ‘Yes’|’No’ buttons will be created.

Returns

result – The dialog button object which was clicked, or None if the dialog was closed without clicking a dialog button.

Return type

DialogButton or None

enaml.stdlib.message_box.warning(parent, title, text, buttons=None)

Display a warning message box with title and text.

On Windows, the dialog will display the stock warning icon.

Parameters
  • parent (Widget or None) – The Enaml widget which should be the parent of the dialog.

  • title (str) – The text for the window title bar.

  • buttons (list, optional) – The list of DialogButton instances to display in the dialog. If this is not provided, an ‘OK’ button will be created.

Returns

result – The dialog button object which was clicked, or None if the dialog was closed without clicking a dialog button.

Return type

DialogButton or None

class enaml.stdlib.message_box.MessageBox(parent=None, **kwargs)

Bases: enaml.widgets.dialog.Dialog

A dialog which provides the functionality of a message box.

This element uses the task dialog components to assemble a dialog based on the provided attribute values.

Simple versions of this dialog can be launched with the functions ‘about’, ‘critical’, ‘information’, ‘question’, and ‘warning’ defined in this module. These functions are intended to be simple and do not provide all options available on this element. If full control over the message box is needed, use this element directly.

image

The image to use for the icon in the dialog body icon area. If this is not provided, no icon area will be generated.

Type

Image, optional

text

The text to display in the instruction area of the dialog. This should always be provided.

Type

basetring

content

The secondary text to place in the content area of the dialog.

Type

str, optional

details

Extra information to show in the details area. This string will be provided to an Html area, and can therefore contain html markup. If this is provided, the details area will be togglable via a check box placed in the dialog command area.

Type

str, optional

buttons

The list of DialogButton objects which define the buttons to display in a DialogButtonBox which is placed in the dialog command area. This should always be provided.

Type

list

__reduce_ex__(proto)

An implementation of the reduce protocol.

This method creates a reduction tuple for enamldef instances. It is not part of the public Enaml api.