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

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

activated

An event fired when an object’s proxy is activated. It is triggered once during the object lifetime, at the end of the activate_proxy method.

background

The background color of the widget.

destroyed

An event fired when an object has been destroyed. It is triggered once during the object lifetime, just before the object is removed from the tree structure.

enabled

Whether or not the widget is enabled.

features

Set the extra features to enable for this widget. This value must be provided when the widget is instantiated. Runtime changes to this value are ignored.

font

The font used for the widget.

foreground

The foreground color of the widget.

initialized

An event fired when an object is initialized. It is triggered once during the object lifetime, at the end of the initialize method.

maximum_size

The maximum size for the widget. The default means that the client should determine an intelligent maximum size.

minimum_size

The minimum size for the widget. The default means that the client should determine an intelligent minimum size.

name

Export the ‘name’ attribute as a declarative member.

status_tip

The status tip to show when the user hovers over the widget.

style_class

The style class to which this item belongs. Multiple classes can be separated with whitespace. An empty string indicates the widget does not belong to any style class.

tool_tip

The tool tip to show when the user hovers over the widget.