pyface.workbench.i_workbench_window_layout module

The workbench window layout interface.

class pyface.workbench.i_workbench_window_layout.IWorkbenchWindowLayout(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]

Bases: Interface

The workbench window layout interface.

Window layouts are responsible for creating and managing the internal structure of a workbench window (it knows how to add and remove views and editors etc).

activate_editor(editor)[source]

Activate an editor.

Returns the editor (just for convenience).

activate_view(view)[source]

Activate a view.

Returns the view (just for convenience).

add_editor(editor, title)[source]

Add an editor.

Returns the editor (just for convenience).

add_view(view, position=None, relative_to=None, size=(-1, -1))[source]

Add a view.

Returns the view (just for convenience).

close_editor(editor)[source]

Close an editor.

Returns the editor (just for convenience).

close_view(view)[source]

Close a view.

FIXME v3: Currently views are never ‘closed’ in the same sense as an editor is closed. When we close an editor, we destroy its control. When we close a view, we merely hide its control. I’m not sure if this is a good idea or not. It came about after discussion with Dave P. and he mentioned that some views might find it hard to persist enough state that they can be re-created exactly as they were when they are shown again.

Returns the view (just for convenience).

close()[source]

Close the entire window layout.

FIXME v3: Should this be called ‘destroy’?

create_initial_layout(parent)[source]

Create the initial window layout.

Returns the layout.

contains_view(view)[source]

Return True if the view exists in the window layout.

Note that this returns True even if the view is hidden.

hide_editor_area()[source]

Hide the editor area.

hide_view(view)[source]

Hide a view.

Returns the view (just for convenience).

refresh()[source]

Refresh the window layout to reflect any changes.

reset_editors()[source]

Activate the first editor in every group.

reset_views()[source]

Activate the first view in every region.

show_editor_area()[source]

Show the editor area.

show_view(view)[source]

Show a view.

get_view_memento()[source]

Returns the state of the views.

set_view_memento(memento)[source]

Restores the state of the views.

get_editor_memento()[source]

Returns the state of the editors.

set_editor_memento(memento)[source]

Restores the state of the editors.

get_toolkit_memento()[source]

Return any toolkit-specific data that should be part of the memento.

set_toolkit_memento(memento)[source]

Restores any toolkit-specific data.

class pyface.workbench.i_workbench_window_layout.MWorkbenchWindowLayout[source]

Bases: HasTraits

Mixin containing common code for toolkit-specific implementations.

activate_editor(editor)[source]

Activate an editor.

activate_view(view)[source]

Activate a view.

add_editor(editor, title)[source]

Add an editor.

add_view(view, position=None, relative_to=None, size=(-1, -1))[source]

Add a view.

close_editor(editor)[source]

Close an editor.

close_view(view)[source]

Close a view.

close()[source]

Close the entire window layout.

create_initial_layout(parent)[source]

Create the initial window layout.

contains_view(view)[source]

Return True if the view exists in the window layout.

hide_editor_area()[source]

Hide the editor area.

hide_view(view)[source]

Hide a view.

refresh()[source]

Refresh the window layout to reflect any changes.

reset_editors()[source]

Activate the first editor in every group.

reset_views()[source]

Activate the first view in every region.

show_editor_area()[source]

Show the editor area.

show_view(view)[source]

Show a view.

get_view_memento()[source]

Returns the state of the views.

set_view_memento(memento)[source]

Restores the state of the views.

get_editor_memento()[source]

Returns the state of the editors.

set_editor_memento(memento)[source]

Restores the state of the editors.

get_toolkit_memento()[source]

Return any toolkit-specific data that should be part of the memento.

set_toolkit_memento(memento)[source]

Restores any toolkit-specific data.