enaml.widgets.dock_area

Classes

DockArea

A component which arranges dock item children.

class enaml.widgets.dock_area.DockArea(parent=None, **kwargs)[source]

Bases: enaml.widgets.constraints_widget.ConstraintsWidget

A component which arranges dock item children.

layout

The layout of dock items for the area. This attribute is not kept in sync with the layout state of the widget at runtime. The ‘save_layout’ method should be called to retrieve the current layout state.

tab_position

The default tab position for newly created dock tabs.

live_drag

Whether the dock items resize as a dock splitter is being dragged (True), or if a simple indicator is drawn until the drag handle is released (False). The default is True.

style

The name of the registered style to apply to the dock area. The list of available styles can be retrieved by calling the function available_styles in the enaml.stdlib.dock_area_styles module. The default is a style inspired by Visual Studio 2010

Users can also define and use their own custom style sheets with the dock area. Simply set this attribute to an empty string so the default styling is disabled, and proceed to use style sheets as with any other widget (see the stdlib styles for inspiration).

Only one mode of styling should be used for the dock area at a time. Using both modes simultaneously is undefined.

dock_events_enabled

Whether or not dock events are enabled for the area.

dock_event

An event emitted when a dock event occurs in the dock area. dock_events_enabled must be True in order to recieve events.

hug_width

A Stack expands freely in height and width by default

proxy

A reference to the ProxyStack widget.

initialized()[source]

A reimplemented initializer method.

This method ensures the internal style sheet is created.

dock_items()[source]

Get the dock items defined on the stack

save_layout()[source]

Save the current layout state of the dock area.

Returns

result – The current layout state of the dock area.

Return type

docklayout

apply_layout(layout)[source]

Apply a new layout to the dock area.

Parameters

layout (DockLayout) – The dock layout to apply to the dock area.

update_layout(ops)[source]

Update the layout configuration using layout operations.

Parameters

ops (DockLayoutOp or iterable) – A single DockLayoutOp instance or an iterable of the same. The operations will be executed in order. If a given op is not valid for the current layout state, it will be skipped.

suppress_dock_events()[source]

A context manager which supresses dock events.

This manager will disable dock events for the duration of the context, and restore the old value upon exit.