Page Contents

This Page

FileDialog

class enaml.widgets.file_dialog.FileDialog(parent=None, **kwargs)[source]

Bases: enaml.core.messenger.Messenger

A dialog widget that allows the user to open and save files and directories.

title = None

The title to use for the dialog.

mode = None

The mode of the dialog.

path = None

The selected path in the dialog. This value will be used to set the initial working directory and file, as appropriate, when the dialog is opened. It will aslo be updated when the dialog is closed and accepted.

paths = None

The list of selected paths in the dialog. It will be updated when the dialog is closed and accepted. It is output only and is only applicable for the open_files mode.

filters = None

The string filters used to restrict the user’s selections.

selected_filter = None

The selected filter from the list of filters. This value will be used as the initial working filter when the dialog is opened. It will also be updated when the dialog is closed and accepted.

native_dialog = None

Whether to use a platform native dialog, when available.

result = None

An enum indicating if the dialog was accepted or rejected by the user. It will be updated when the dialog is closed. This value is output only.

callback = None

An optional callback which will be invoked when the dialog is closed. This is a convenience to make it easier to handle the non-blocking behavior of the dialog. The callback must accept a single argument, which will be the dialog instance.

closed = None

An event fired when the dialog is closed. The dialog state will be updated before this event is fired.

destroy_on_close = None

Whether to destroy the dialog widget on close. The default is True since dialogs are typically used in a transitory fashion. If this value is set to True, the dialog will be destroyed on the completion of the closed event.

open()[source]

Open the dialog for user interaction.

on_action_closed(content)[source]

Handle the ‘closed’ action from the client widget.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_file_dialog.QtFileDialog

class enaml.qt.qt_file_dialog.QtFileDialog(object_id, parent, session)[source]

Bases: enaml.qt.qt_object.QtObject

A Qt implementation of an Enaml FileDialog.

create_widget(parent, tree)[source]

Create the underlying widget.

The file dialog widget is created on-demand when the open action is received. There is no persistent widget created for the file dialog.

on_action_open(content)[source]

Handle the ‘open’ action from the Enaml widget.

Wx