pyface.tasks.task_window module

class pyface.tasks.task_window.TaskWindow[source]

Bases: ApplicationWindow

The the top-level window to which tasks can be assigned.

A TaskWindow is responsible for creating and the managing the controls of its tasks.

title = Property(Str, observe=["active_task.name", "_title"])

Unless a title is specifically assigned, delegate to the active task.

active_pane = Instance(ITaskPane)

The pane (central or dock) in the active task that currently has focus.

active_task = Instance(Task)

The active task for this window.

tasks = List(Task)

The list of all tasks currently attached to this window. All panes of the inactive tasks are hidden.

central_pane = Instance(ITaskPane)

The central pane of the active task, which is always visible.

dock_panes = List(IDockPane)

The list of all dock panes in the active task, which may or may not be visible.

action_manager_builder_factory = Callable(TaskActionManagerBuilder)

The factory for the window’s TaskActionManagerBuilder, which is instantiated to translate menu and tool bar schemas into Pyface action managers. This attribute can overridden to introduce custom logic into the translation process, although this is not usually necessary.

destroy()[source]

Overridden to ensure that all task panes are cleanly destroyed.

open()[source]

Opens the window.

Overridden to make the ‘opening’ event vetoable and to activate a task if one has not already been activated. Returns whether the window was opened.

activate_task(task)[source]

Activates a task that has already been added to the window.

add_task(task)[source]

Adds a task to the window. The task is not activated.

remove_task(task)[source]

Removes a task that has already been added to the window. All the task’s panes are destroyed.

focus_next_pane()[source]

Shifts focus to the “next” pane, taking into account the active pane and the pane geometry.

focus_previous_pane()[source]

Shifts focus to the “previous” pane, taking into account the active pane and the pane geometry.

get_central_pane(task)[source]

Returns the central pane for the specified task.

get_dock_pane(id, task=None)[source]

Returns the dock pane in the task with the specified ID, or None if no such dock pane exists. If a task is not specified, the active task is used.

get_dock_panes(task)[source]

Returns the dock panes for the specified task.

get_task(id)[source]

Returns the task with the specified ID, or None if no such task exists.

get_layout()[source]

Returns a TaskLayout (for the active task) that reflects the state of the window.

set_layout(layout)[source]

Applies a TaskLayout (which should be suitable for the active task) to the window.

reset_layout()[source]

Restores the active task’s default TaskLayout.

get_window_layout()[source]

Returns a TaskWindowLayout for the current state of the window.

set_window_layout(window_layout)[source]

Applies a TaskWindowLayout to the window.

class pyface.tasks.task_window.TaskState[source]

Bases: HasStrictTraits

An object used internally by TaskWindow to maintain the state associated with an attached Task.

task = Instance(Task)

The Task that the state comes from.

layout = Instance(TaskLayout)

The layout of panes in the TaskWindow.

initialized = Bool(False)

Whether the task state has been initialized.

central_pane = Instance(ITaskPane)

The central pane of the TaskWindow

dock_panes = List(Instance(IDockPane))

The list of all dock panes.

menu_bar_manager = Instance(IMenuBarManager)

The TaskWindow’s menu bar manager instance.

status_bar_manager = Instance(IStatusBarManager)

The TaskWindow’s status bar instance.

tool_bar_managers = List(Instance(IToolBarManager))

The TaskWindow’s tool bar instances.

get_dock_pane(id)[source]

Returns the dock pane with the specified id, or None if no such dock pane exists.