Page Contents

This Page

TraitsItem

class enaml.widgets.traits_item.TraitsItem(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A control which can be used to embded a traits ui view.

model = None

The traits model being displayed. If no other view is given, the view will be retrieved by calling model.edit_traits().

view = None

An optional traits ui View definition to use in lieu of the default view generated by the model.

handler = None

An optional traits ui Handler definition to use in lieu of the default handler generated by the model.

hug_width = None

TraitsItem widgets expand freely in height and width by default.

snapshot()[source]

Get the snapshot dictionary for the TraitsItem widget.

bind()[source]

Bind the change handlers for the control.

Backends

Qt

digraph inheritance21f358f412 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "QtWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.qt.qt_widget.QtWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtObject" -> "QtWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.qt.qt_constraints_widget.QtConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtWidget" -> "QtConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "QtTraitsItem" [style="setlinewidth(0.5)",URL="#enaml.qt.qt_traits_item.QtTraitsItem",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtControl" -> "QtTraitsItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.qt.qt_control.QtControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtConstraintsWidget" -> "QtControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class enaml.qt.qt_traits_item.QtTraitsItem(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A Qt implementation of an Enaml TraitsItem.

create_widget(parent, tree)[source]

Create the underlying widget.

create(tree)[source]

Create and initialize the underlying widget.

init_layout()[source]

Initialize the layout for the widget.

on_action_set_model(content)[source]

Handle the ‘set_model’ action from the Enaml widget.

on_action_set_view(content)[source]

Handle the ‘set_view’ action from the Enaml widget.

on_action_set_handler(content)[source]

Handle the ‘set_handler’ action from the Enaml widget.

refresh_traits_widget()[source]

Create the traits widget and update the underlying control.

Wx

digraph inheritance37281ffd47 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "WxTraitsItem" [style="setlinewidth(0.5)",URL="#enaml.wx.wx_traits_item.WxTraitsItem",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxControl" -> "WxTraitsItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.wx.wx_widget.WxWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxObject" -> "WxWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.wx.wx_control.WxControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxConstraintsWidget" -> "WxControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "WxConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.wx.wx_constraints_widget.WxConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxWidget" -> "WxConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class enaml.wx.wx_traits_item.WxTraitsItem(object_id, parent, session)[source]

Bases: enaml.wx.wx_control.WxControl

A Wx implementation of an Enaml TraitsItem.

create_widget(parent, tree)[source]

Create the underlying widget.

create(tree)[source]

Create and initialize the underlying widget.

init_layout()[source]

Initialize the layout for the widget.

on_action_set_model(content)[source]

Handle the ‘set_model’ action from the Enaml widget.

on_action_set_view(content)[source]

Handle the ‘set_view’ action from the Enaml widget.

on_action_set_handler(content)[source]

Handle the ‘set_handler’ action from the Enaml widget.

refresh_traits_widget(notify=True)[source]

Create the traits widget and update the underlying control.

Parameters:notify (bool, optional) – Whether to notify the layout system if the size hint of the widget has changed. The default is True.