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.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_traits_item.QtTraitsItem

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

Inheritance diagram of enaml.wx.wx_traits_item.WxTraitsItem

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.