pyface.workbench.workbench module

A workbench.

class pyface.workbench.workbench.Workbench[source]

Bases: HasTraits

A workbench.

There is exactly one workbench per application. The workbench can create any number of workbench windows.

create_window(**kw)[source]

Factory method that creates a new workbench window.

exit()[source]

Exits the workbench.

This closes all open workbench windows.

This method is not called when the user clicks the close icon. Nor when they do an Alt+F4 in Windows. It is only called when the application menu File->Exit item is selected.

Returns True if the exit succeeded, False if it was vetoed.

edit(obj, kind=None, use_existing=True)[source]

Edit an object in the active workbench window.

get_editor(obj, kind=None)[source]

Return the editor that is editing an object.

Returns None if no such editor exists.

get_editor_by_id(id)[source]

Return the editor with the specified Id.

Returns None if no such editor exists.

confirm(message, title=None, cancel=False, default=40)[source]

Convenience method to show a confirmation dialog.

information(message, title='Information')[source]

Convenience method to show an information message dialog.

warning(message, title='Warning')[source]

Convenience method to show a warning message dialog.

error(message, title='Error')[source]

Convenience method to show an error message dialog.