class ModalDialog(Dialog)

The ModalDialog class is a subclass of Dialog designed for modal dialogs. It has a default style of 'modal_dialog' and provides facilities for presenting the dialog modally.

While a ModalDialog is active, interaction with other parts of the application is prevented. Other windows cannot be activated, application-wide menu commands other than those used by the dialog itself are not enabled, and unhandled events and messages are not forwarded to the application.


ModalDialog(style = 'modal_dialog',
    closable = False, resizable = False, zoomable = False,
    movable = default, hidabledefault)

Constructs a ModalDialog with the specified options. The default values for the movable and hidable options are platform-dependent.


Present the dialog modally. The dialog is shown and a nested event loop is entered which prevents interaction with any other part of the application. This method retains control until the dialog's dismiss() method is called. The dialog is then hidden and the present() method returns with the value passed to dismiss().
dismiss(result = 0)
Hides the dialog and, if the dialog is being presented modally, causes the present() method to return with the given result as its return value.

Dismisses the dialog with the value True. By default, this method is called in response to pressing a DefaultButton or a Return/Enter key event.

Dismisses the dialog with the value False. By default, this method is called in response to pressing a CancelButton or an Escape key event.