enaml.stdlib.dialog_buttons

Classes

DialogButton

A class for specifying a button in a button box.

DialogButtonBox

A component for defining a button box for a dialog.

class enaml.stdlib.dialog_buttons.DialogButton(text, action, **kwargs)

Bases: atom.atom.Atom

A class for specifying a button in a button box.

Instances of this class are created by users to specify the buttons which will be shown in a DialogButtonBox.

__init__(text, action, **kwargs)

Initialize a DialogButton.

Parameters
  • text (unicode) – The unicode label for the button.

  • action ('accept' or 'reject') – The dialog action to perform when the button is clicked.

  • **kwargs – Additional optional state to apply to the button.

class enaml.stdlib.dialog_buttons.DialogButtonBox(parent=None, **kwargs)

Bases: enaml.widgets.container.Container

A component for defining a button box for a dialog.

The dialog button box must be used as a decendant of a Dialog, and relies on dynamic scoping to invoke the dialog action when a button is clicked. The button widgets created by the dialog can be styled using the style class ‘dialog-box-button’.

buttons

A list of DialogButton objects which represent the buttons to create for the dialog box. This value should be set before the widget is shown. Dynamic changes will not update the UI.

Type

list

Events
------
clicked

This event will be emitted when a button is clicked, but before the dialog action is taken. The payload will be the DialogButton instance for the button which was clicked.

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