pyface.action.traitsui_widget_action module

class pyface.action.traitsui_widget_action.TraitsUIWidgetAction[source]

Bases: Action

A widget action containing a TraitsUI.

If a object is supplied, then the UI is generated from the object’s view, otherwise the ui is generated on using the Action object.

Notes

This is currently only supported by the Qt backend.

model = Instance(HasTraits)

The underlying traits model to be displayed, or None.

style = Constant("widget")

This is a widget action.

create_control(parent)[source]

Called when creating a “widget” style action.

This constructs an TraitsUI subpanel-based control. It does no binding to the perform method.

Parameters

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

Returns

control – A toolkit control or None.

Return type

toolkit control

trait_context()[source]

Use the model object for the Traits UI context, if appropriate.