Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > contrib-backports > by-pkgid > 5a28ce08f20e322d24ac159a4334c346 > files > 2420

python-enthought-mayavi2-2.2.0-1mdv2008.1.x86_64.rpm

""" An example view. """


# Standard library imports.
import os

# Enthought library imports.
from enthought.envisage.ui.view import View

# Local imports.
from file_system import FileSystem, Folder
from file_system_tree_view import file_system_tree_view


class ExampleView(View):
    """ An example view. """

    ###########################################################################
    # 'View' interface.
    ###########################################################################

    def _create_contents(self, parent):
        """ Create the toolkit-specific control that represents the view.

        'parent' is the toolkit-specific control that is the view's parent.

        """

        file_system = FileSystem(root=Folder(path=os.path.abspath(os.curdir)))

        ui = file_system.edit_traits(
            parent=parent, kind='subpanel', view=file_system_tree_view
        )

        return ui.control
    
#### EOF ######################################################################