pyface.tasks.task module

class pyface.tasks.task.Task[source]

Bases: HasTraits

A collection of pane, menu, tool bar, and status bar factories.

The central class in the Tasks plugin, a Task is responsible for describing a set of user interface elements, as well as mediating between its view (a TaskWindow) and an application-specific model.

id = Str()

The task’s identifier.

name = Str()

The task’s user-visible name.

default_layout = Instance(TaskLayout, ())

The default layout to use for the task. If not overridden, only the central pane is displayed.

extra_dock_pane_factories = List(Callable)

A list of extra IDockPane factories for the task. These dock panes are used in conjunction with the dock panes returned by create_dock_panes().

window = Instance("pyface.tasks.task_window.TaskWindow")

The window to which the task is attached. Set by the framework.

menu_bar = Instance(MenuBarSchema)

The menu bar for the task.

status_bar = Instance("pyface.action.status_bar_manager.StatusBarManager")

The (optional) status bar for the task.

tool_bars = List(ToolBarSchema)

The list of tool bars for the tasks.

extra_actions = List(SchemaAddition)

A list of extra actions, groups, and menus that are inserted into menu bars and tool bars constructed from the above schemas.

activated()[source]

Called after the task has been activated in a TaskWindow.

create_central_pane()[source]

Create and return the central pane, which must implement ITaskPane.

create_dock_panes()[source]

Create and return the task’s dock panes (IDockPane instances).

This method is called after create_central_pane() when the task is added to a TaskWindow.

initialized()[source]

Called when the task is about to be activated in a TaskWindow for the first time.

Override this method to perform any initialization that requires the Task’s panes to be instantiated. Note that this method, when called, is called before activated().

prepare_destroy()[source]

Called when the task is about to be removed from its TaskWindow.

Override this method to perform any cleanup before the task’s controls are destroyed.