Page Contents

This Page

FlowItem

class enaml.widgets.flow_item.FlowItem(parent=None, **kwargs)[source]

Bases: enaml.widgets.widget.Widget

A widget which can be used as an item in a FlowArea.

A FlowItem is a widget which can be used as a child of a FlowArea widget. It can have at most a single child widget which is an instance of Container.

preferred_size = None

The preferred size of this flow item. This size will be used as the size of the item in the layout, bounded to the computed min and max size. A size of (-1, -1) indicates to use the widget’s size hint as the preferred size.

align = None

The alignment of this item in the direction orthogonal to the layout flow.

stretch = None

The stretch factor for this item in the flow direction, relative to other items in the same line. The default is zero which means that the item will not expand in the direction orthogonal to the layout flow.

ortho_stretch = None

The stretch factor for this item in the orthogonal direction relative to other items in the layout. The default is zero which means that the item will not expand in the direction orthogonal to the layout flow.

flow_widget = None

A read only property which returns the items’s flow widget.

snapshot()[source]

Returns the snapshot dict for the FlowItem.

bind()[source]

Bind the change handler for the FlowItem.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_flow_item.QtFlowItem

class enaml.qt.qt_flow_item.QtFlowItem(object_id, parent, session)[source]

Bases: enaml.qt.qt_widget.QtWidget

A Qt implementation of an Enaml FlowItem.

create_widget(parent, tree)[source]

Create the underlying QFlowItem widget.

create(tree)[source]

Create and initialize the underlying control.

init_layout()[source]

Initialize the layout for the underyling widget.

flow_widget()[source]

Find and return the flow widget child for this widget.

Returns:result (QWidget or None) – The flow widget defined for this widget, or None if one is not defined.
child_removed(child)[source]

Handle the child added event for a QtFlowItem.

child_added(child)[source]

Handle the child added event for a QtFlowItem.

on_action_set_preferred_size(content)[source]

Handle the ‘set_preferred_size’ action from the Enaml widget.

on_action_set_align(content)[source]

Handle the ‘set_align’ action from the Enaml widget.

on_action_set_stretch(content)[source]

Handle the ‘set_stretch’ action from the Enaml widget.

on_action_set_ortho_stretch(content)[source]

Handle the ‘set_ortho_stretch’ action from the Enaml widget.

set_preferred_size(size)[source]

Set the preferred size of the underlying widget.

set_align(align)[source]

Set the alignment of the underlying widget.

set_stretch(stretch)[source]

Set the stretch factor of the underlying widget.

set_ortho_stretch(stretch)[source]

Set the ortho stretch factor of the underling widget.

Wx