File: example_workbench.py

package info (click to toggle)
python-pyface 8.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,944 kB
  • sloc: python: 54,107; makefile: 82
file content (30 lines) | stat: -rw-r--r-- 865 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
""" A simple example of using the workbench. """


from pyface.api import YES
from pyface.workbench.api import Workbench


from example_workbench_window import ExampleWorkbenchWindow


class ExampleWorkbench(Workbench):
    """ A simple example of using the workbench. """

    # 'Workbench' interface ------------------------------------------------

    # The factory (in this case simply a class!) that is used to create
    # workbench windows.
    window_factory = ExampleWorkbenchWindow

    # ------------------------------------------------------------------------
    # Private interface.
    # ------------------------------------------------------------------------

    def _exiting_changed(self, event):
        """ Called when the workbench is exiting. """

        if self.confirm("Ok to exit?") != YES:
            event.veto = True

        return