[]Struct gtk::FileChooserButton

pub struct FileChooserButton(_, _);

The FileChooserButton is a widget that lets the user select a file. It implements the FileChooser interface. Visually, it is a file name with a button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that button. This widget does not support setting the FileChooser:select-multiple property to true.

Create a button to let the user select a file in /etc

{
  GtkWidget *button;

  button = gtk_file_chooser_button_new (_("Select a file"),
                                        GTK_FILE_CHOOSER_ACTION_OPEN);
  gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
                                       "/etc");
}

The FileChooserButton supports the GtkFileChooserActions FileChooserAction::Open and FileChooserAction::SelectFolder.

The FileChooserButton will ellipsize the label, and will thus request little horizontal space. To give the button more space, you should call WidgetExt::get_preferred_size, FileChooserButtonExt::set_width_chars, or pack the button in such a way that other interface elements give space to the widget.

CSS nodes

FileChooserButton has a CSS node with name “filechooserbutton”, containing a subnode for the internal button with name “button” and style class “.file”.

Implements

FileChooserButtonExt, BoxExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, OrientableExt, FileChooserExt, WidgetExtManual, BuildableExtManual

Implementations

impl FileChooserButton[src]

pub fn new(title: &str, action: FileChooserAction) -> FileChooserButton[src]

Creates a new file-selecting button widget.

title

the title of the browse dialog.

action

the open mode for the widget.

Returns

a new button widget.

pub fn with_dialog<P: IsA<Dialog>>(dialog: &P) -> FileChooserButton[src]

Trait Implementations

impl Clone for FileChooserButton

impl Debug for FileChooserButton

impl Display for FileChooserButton[src]

impl Eq for FileChooserButton

impl Hash for FileChooserButton

impl IsA<Box> for FileChooserButton

impl IsA<Buildable> for FileChooserButton

impl IsA<Container> for FileChooserButton

impl IsA<FileChooser> for FileChooserButton

impl IsA<Orientable> for FileChooserButton

impl IsA<Widget> for FileChooserButton

impl Ord for FileChooserButton

impl<T: ObjectType> PartialEq<T> for FileChooserButton

impl<T: ObjectType> PartialOrd<T> for FileChooserButton

impl StaticType for FileChooserButton

Auto Trait Implementations

impl RefUnwindSafe for FileChooserButton

impl !Send for FileChooserButton

impl !Sync for FileChooserButton

impl Unpin for FileChooserButton

impl UnwindSafe for FileChooserButton

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.