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.


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.


Called when creating a “widget” style action.

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


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


control – A toolkit control or None.

Return type

toolkit control


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