enaml.widgets.abstract_button

Classes

AbstractButton

A base class for creating button-like controls.

class enaml.widgets.abstract_button.AbstractButton(parent=None, **kwargs)[source]

Bases: Control

A base class for creating button-like controls.

text

The text to use as the button’s label.

icon

The source url for the icon to use for the button.

icon_size

The size to use for the icon. The default is an invalid size and indicates that an appropriate default should be used.

group

Group to which this button belongs to.

checkable

Whether or not the button is checkable. The default is False.

checked

Whether a checkable button is currently checked.

clicked

Fired when the button is pressed then released. The payload will be the current checked state. This event is triggered by the proxy object when the button is clicked.

toggled

Fired when a checkable button is toggled. The payload will be the current checked state. This event is triggered by the proxy object when a togglable button is toggled.

hug_width

Buttons hug their contents’ width weakly by default.

proxy

A reference to the ProxyAbstractButton object.

__init__(parent=None, **kwargs)[source]

Initialize an Object.

Parameters
  • parent (Object or None, optional) – The Object instance which is the parent of this object, or None if the object has no parent. Defaults to None.

  • **kwargs – Additional keyword arguments to apply as attributes to the object.

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.

initialized

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

name

Export the ‘name’ attribute as a declarative member.

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.