1
# Copyright (c) 2007, Enthought, Inc.
5
Implementation of a DirectoryEditor demo plugin for Traits UI demo program.
7
This demo shows each of the four styles of the DirectoryEditor
12
import HasTraits, Directory
15
import Item, Group, View
17
# Define the demo class:
18
class DirectoryEditorDemo ( HasTraits ):
19
""" Define the main DirectoryEditor demo class. """
21
# Define a Directory trait to view:
25
# Display specification (one Item per editor style):
27
Item( 'dir_name', style = 'simple', label = 'Simple' ),
29
Item( 'dir_name', style = 'custom', label = 'Custom' ),
31
Item( 'dir_name', style = 'text', label = 'Text' ),
33
Item( 'dir_name', style = 'readonly', label = 'ReadOnly' )
39
title = 'DirectoryEditor',
45
demo = DirectoryEditorDemo()
47
# Run the demo (if invoked from the command line):
48
if __name__ == '__main__':
49
demo.configure_traits()