traitsui.message module

Displays a message to the user as a modal window.

class traitsui.message.AutoCloseMessage

Bases: traits.has_traits.HasPrivateTraits

message = Str("Please wait")

The message to be shown:

show(parent=None, title='')

Display the wait message for a limited duration.

time = Float(2.0)

The time (in seconds) to show the message:

class traitsui.message.Message

Bases: traits.has_traits.HasPrivateTraits

message = Str()

The message to be displayed

traitsui.message.auto_close_message(message='Please wait', time=2.0, title='Please wait', parent=None)

Displays a message to the user as a modal window with no buttons. The window closes automatically after a specified time interval (specified in seconds).

traitsui.message.error(message='', title='Message', buttons=['OK', 'Cancel'], parent=None)

Displays a message to the user as a modal window with the specified title and buttons.

If buttons is not specified, OK and Cancel buttons are used, which is appropriate for confirmations, where the user must decide whether to proceed. Be sure to word the message so that it is clear that clicking OK continues the operation.

traitsui.message.message(message='', title='Message', buttons=['OK'], parent=None)

Displays a message to the user as a model window with the specified title and buttons.

If buttons is not specified, a single OK button is used, which is appropriate for notifications, where no further action or decision on the user’s part is required.