pyface.action.field_action module

class pyface.action.field_action.FieldAction[source]

Bases: Action

A widget action containing an IField

When the value in the field is changed, the on_perform method is called with the new value as the argument.

style = Constant("widget")

This is a widget action.

field_type = Type(IField)

The field to display.

field_defaults = Dict(Str, Any)

The default trait values for the field.


Called when creating a “widget” style action.

This constructs an IField-based control directly and binds changes to the value to the value_updated method.


parent (toolkit control) – The toolkit control, usually a toolbar.


control – A toolkit control or None.

Return type

toolkit control


Handle changes to the field value by calling perform.

The event passed to perform has the value as an attribute.


Performs the action.

This dispacthes to the on_perform method with the new value passed as an argument.


event (ActionEvent) – The event which triggered the action.