pub struct FileSelectPanel {
    pub panel: ShareId<Object>,
    pub delegate: ShareId<Object>,
    pub can_choose_files: bool,
    pub can_choose_directories: bool,
    pub resolves_aliases: bool,
    pub allows_multiple_selection: bool,
}

Fields

panel: ShareId<Object>

The internal Objective C NSOpenPanel instance.

delegate: ShareId<Object>

The internal NSObject that routes delegate callbacks around.

can_choose_files: bool

Whether the user can choose files. Defaults to true.

can_choose_directories: bool

Whether the user can choose directories. Defaults to false.

resolves_aliases: bool

When the value of this property is true, dropping an alias on the panel or asking for filenames or URLs returns the resolved aliases. The default value of this property is true. When this value is false, selecting an alias returns the alias instead of the file or directory it represents.

allows_multiple_selection: bool

When the value of this property is true, the user may select multiple items from the browser. Defaults to false.

Implementations

Creates and returns a FileSelectPanel, which holds pointers to the Objective C runtime for instrumenting the dialog.

Sets whether files can be chosen by the user.

Set the message text displayed in the panel.

Sets whether the user can choose directories.

Sets whether the panel resolves aliases.

Sets whether the panel allows multiple selections.

Shows the panel as a modal.

Note that this clones the underlying NSOpenPanel pointer. This is theoretically safe as the system runs and manages that in another process, and we’re still abiding by the general retain/ownership rules here.

This is offered for scenarios where you don’t necessarily have a Window (e.g, a shell script) or can’t easily pass one to use as a sheet.

As panels descend behind the scenes from NSWindow, we can call through to close it.

You should really prefer to utilize sheets to display panels; this is offered as a convenience for rare cases where you might need to retain a panel and close it later on.

Shows the panel as a modal. Currently, this method accepts Windows which use a delegate. If you’re using a Window without a delegate, you may need to opt to use the show() method.

Note that this clones the underlying NSOpenPanel pointer. This is theoretically safe as the system runs and manages that in another process, and we’re still abiding by the general retain/ownership rules here.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.