Module Expr Str ImportFrom alias alias alias ImportFrom alias alias alias ImportFrom alias alias Assign NameStore Str ClassDef bases NameLoad body Assign NameStore NameLoad Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Call NameLoad Call NameLoad Str keyword NameLoad Str Call NameLoad Str keyword Str keyword NameLoad keyword Num FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Call NameLoad keyword Str keyword NameLoad If CompareNotEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list Assign NameStore Call NameLoad If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A 
This demonstrates using the Traits file dialog with a file dialog extension,
in this case, the <b>TextInfo</b> extension, which displays (if possible) the
contents of the currently selected file in a read-only text editor so the user
can quickly verify they are opening the correct file before leaving the file
dialog.

For more information about why you would want to use the Traits file dialog
over the standard OS file dialog, select the <b>File Open</b> demo. For a
demonstration of writing a custom file dialog extension, select the
<b>File Open with Custom Extension</b> demo.

This example also shows setting a file name filter which only allows Python
source (i.e. *.py) files to be viewed and selected.
 traits.api HasTraits File Button traitsui.api View HGroup Item traitsui.file_dialog open_file TextInfo N/A demo_id traitsui.demo.standard_editors.file_dialog.text_info FileDialogDemo N/A HasTraits N/A N/A file_name File N/A open N/A Button Open... N/A view N/A View N/A HGroup N/A Item open show_label False _ N/A Item file_name style readonly springy True width 0.5 _open_changed N/A N/A self N/A N/A N/A  Handles the user clicking the 'Open...' button.
         N/A file_name N/A open_file extensions N/A TextInfo filter Python file (*.py)|*.py id demo_id N/A N/A file_name N/A N/A N/A self file_name file_name N/A N/A N/A demo N/A FileDialogDemo N/A N/A __name__ __main__ N/A N/A N/A N/A demo configure_traits