[]Struct gtk::RecentChooserDialog

pub struct RecentChooserDialog(_, _);

RecentChooserDialog is a dialog box suitable for displaying the recently used documents. This widgets works by putting a RecentChooserWidget inside a Dialog. It exposes the RecentChooserIface interface, so you can use all the RecentChooser functions on the recent chooser dialog as well as those for Dialog.

Note that RecentChooserDialog does not have any methods of its own. Instead, you should use the functions that work on a RecentChooser.

Typical usage ## {gtkrecentchooser-typical-usage}

In the simplest of cases, you can use the following code to use a RecentChooserDialog to select a recently used file:

GtkWidget *dialog;
gint res;

dialog = gtk_recent_chooser_dialog_new ("Recent Documents",
                                        parent_window,
                                        _("_Cancel"),
                                        GTK_RESPONSE_CANCEL,
                                        _("_Open"),
                                        GTK_RESPONSE_ACCEPT,
                                        NULL);

res = gtk_dialog_run (GTK_DIALOG (dialog));
if (res == GTK_RESPONSE_ACCEPT)
  {
    GtkRecentInfo *info;
    GtkRecentChooser *chooser = GTK_RECENT_CHOOSER (dialog);

    info = gtk_recent_chooser_get_current_item (chooser);
    open_file (gtk_recent_info_get_uri (info));
    gtk_recent_info_unref (info);
  }

gtk_widget_destroy (dialog);

Recently used files are supported since GTK+ 2.10.

Implements

DialogExt, GtkWindowExt, BinExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, RecentChooserExt, DialogExtManual, GtkWindowExtManual, WidgetExtManual, BuildableExtManual

Implementations

impl RecentChooserDialog[src]

pub fn new<T: IsA<Window>>(
    title: Option<&str>,
    parent: Option<&T>
) -> RecentChooserDialog
[src]

Creates a new RecentChooserDialog. This function is analogous to Dialog::new_with_buttons.

title

Title of the dialog, or None

parent

Transient parent of the dialog, or None,

first_button_text

stock ID or text to go in the first button, or None

Returns

a new RecentChooserDialog

pub fn new_for_manager<T: IsA<Window>>(
    title: Option<&str>,
    parent: Option<&T>,
    manager: &RecentManager
) -> RecentChooserDialog
[src]

Creates a new RecentChooserDialog with a specified recent manager.

This is useful if you have implemented your own recent manager, or if you have a customized instance of a RecentManager object.

title

Title of the dialog, or None

parent

Transient parent of the dialog, or None,

manager

a RecentManager

first_button_text

stock ID or text to go in the first button, or None

Returns

a new RecentChooserDialog

Trait Implementations

impl Clone for RecentChooserDialog

impl Debug for RecentChooserDialog

impl Display for RecentChooserDialog[src]

impl Eq for RecentChooserDialog

impl Hash for RecentChooserDialog

impl IsA<Bin> for RecentChooserDialog

impl IsA<Buildable> for RecentChooserDialog

impl IsA<Container> for RecentChooserDialog

impl IsA<Dialog> for RecentChooserDialog

impl IsA<RecentChooser> for RecentChooserDialog

impl IsA<Widget> for RecentChooserDialog

impl IsA<Window> for RecentChooserDialog

impl Ord for RecentChooserDialog

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

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

impl StaticType for RecentChooserDialog

Auto Trait Implementations

impl RefUnwindSafe for RecentChooserDialog

impl !Send for RecentChooserDialog

impl !Sync for RecentChooserDialog

impl Unpin for RecentChooserDialog

impl UnwindSafe for RecentChooserDialog

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.