Module: Gtk::RecentChooser

Defined in:
(unknown)

Overview

Gtk::RecentChooser is an interface that can be implemented by widgets displaying the list of recently used files. In GTK+, the main objects that implement this interface are Gtk::RecentChooserWidget, Gtk::RecentChooserDialog and #GtkRecentChooserMenu.

Recently used files are supported since GTK+ 2.10.

Instance Method Summary collapse

Instance Method Details

#add_filter(chooser, filter) ⇒ nil

Parameters:

Returns:

  • (nil)

#current_itemGtk::RecentInfo

Gets the Gtk::RecentInfo currently selected by chooser.

Returns:

  • (Gtk::RecentInfo)

    a Gtk::RecentInfo. Use gtk_recent_info_unref() when when you have finished using it.

#current_uriString

Gets the URI currently selected by chooser.

Returns:

  • (String)

    a newly allocated string holding a URI.

#current_uri=(uri) ⇒ TrueClass

Sets uri as the current URI for chooser.

Parameters:

  • uri (String)

    a URI

Returns:

  • (TrueClass)

    true if the URI was found.

#filterGtk::RecentFilter

Gets the Gtk::RecentFilter object currently used by chooser to affect the display of the recently used resources.

Returns:

#filter=(filter) ⇒ nil

Sets filter as the current Gtk::RecentFilter object used by chooser to affect the displayed recently used resources.

Parameters:

Returns:

  • (nil)

#get_current_uri(chooser) ⇒ String

Returns a newly allocated string holding a URI.

Parameters:

Returns:

  • (String)

    a newly allocated string holding a URI.

#get_items(chooser) ⇒ GLib::List

Returns A newly allocated list of Gtk::RecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().

Parameters:

Returns:

  • (GLib::List)

    A newly allocated list of Gtk::RecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().

#get_recent_manager(chooser) ⇒ Gtk::RecentManager

Parameters:

Returns:

#get_uris(length) ⇒ Array<String>

Gets the URI of the recently used resources.

The return value of this function is affected by the “sort-type” and “limit” properties of chooser.

Since the returned array is nil terminated, length may be nil.

Parameters:

  • length (Integer)

    return location for a the length of the URI list, or nil

Returns:

  • (Array<String>)

    A newly allocated, nil-terminated array of strings. Use g_strfreev() to free it.

#item_activated(chooser) ⇒ nil

Parameters:

Returns:

  • (nil)

#itemsGLib::List

Gets the list of recently used resources in form of Gtk::RecentInfo objects.

The return value of this function is affected by the “sort-type” and “limit” properties of chooser.

Returns:

  • (GLib::List)

    A newly allocated list of Gtk::RecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().

#limitInteger

Gets the number of items returned by gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().

Returns:

  • (Integer)

    A positive integer, or -1 meaning that all items are returned.

#limit=(limit) ⇒ nil

Sets the number of items that should be returned by gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().

Parameters:

  • limit (Integer)

    a positive integer, or -1 for all items

Returns:

  • (nil)

#list_filters(chooser) ⇒ GLib::SList

Returns A singly linked list of Gtk::RecentFilter objects. You should just free the returned list using g_slist_free().

Parameters:

Returns:

  • (GLib::SList)

    A singly linked list of Gtk::RecentFilter objects. You should just free the returned list using g_slist_free().

#local_onlyTrueClass

Gets whether only local resources should be shown in the recently used resources selector. See gtk_recent_chooser_set_local_only()

Returns:

  • (TrueClass)

    true if only local resources should be shown.

#local_only=(local_only) ⇒ nil

Sets whether only local resources, that is resources using the file:// URI scheme, should be shown in the recently used resources selector. If local_only is true (the default) then the shown resources are guaranteed to be accessible through the operating system native file system.

Parameters:

  • local_only (TrueClass)

    true if only local files can be shown

Returns:

  • (nil)

#recent_managerGtk::RecentManager

Returns:

#remove_filter(chooser, filter) ⇒ nil

Parameters:

Returns:

  • (nil)

#select_all(chooser) ⇒ nil

Parameters:

Returns:

  • (nil)

#select_multipleTrueClass

Gets whether chooser can select multiple items.

Returns:

  • (TrueClass)

    true if chooser can select more than one item.

#select_multiple=(select_multiple) ⇒ nil

Sets whether chooser can select multiple items.

Parameters:

  • select_multiple (TrueClass)

    true if chooser can select more than one item

Returns:

  • (nil)

#select_uri(chooser, uri) ⇒ TrueClass

Returns true if uri was found.

Parameters:

Returns:

  • (TrueClass)

    true if uri was found.

#selection_changed(chooser) ⇒ nil

Parameters:

Returns:

  • (nil)

#set_current_uri(chooser, uri) ⇒ TrueClass

Returns true if the URI was found.

Parameters:

Returns:

  • (TrueClass)

    true if the URI was found.

#set_sort_func(chooser, sort_func, sort_data, data_destroy) ⇒ nil

Parameters:

  • chooser (Gtk::RecentChooser)

    a Gtk::RecentChooser

  • sort_func (Gtk::RecentSortFunc)

    the comparison function

  • sort_data (GObject)

    user data to pass to sort_func, or nil

  • data_destroy (GLib::DestroyNotify)

    destroy notifier for sort_data, or nil

Returns:

  • (nil)

#show_iconsTrueClass

Retrieves whether chooser should show an icon near the resource.

Returns:

  • (TrueClass)

    true if the icons should be displayed, false otherwise.

#show_icons=(show_icons) ⇒ nil

Sets whether chooser should show an icon near the resource when displaying it.

Parameters:

  • show_icons (TrueClass)

    whether to show an icon near the resource

Returns:

  • (nil)

#show_not_foundTrueClass

Retrieves whether chooser should show the recently used resources that were not found.

Returns:

  • (TrueClass)

    true if the resources not found should be displayed, and false otheriwse.

#show_not_found=(show_not_found) ⇒ nil

Sets whether chooser should display the recently used resources that it didn’t find. This only applies to local resources.

Parameters:

  • show_not_found (TrueClass)

    whether to show the local items we didn’t find

Returns:

  • (nil)

#show_privateTrueClass

Returns whether chooser should display recently used resources registered as private.

Returns:

  • (TrueClass)

    true if the recent chooser should show private items, false otherwise.

#show_private=(show_private) ⇒ nil

Whether to show recently used resources marked registered as private.

Parameters:

  • show_private (TrueClass)

    true to show private items, false otherwise

Returns:

  • (nil)

#show_tipsTrueClass

Gets whether chooser should display tooltips containing the full path of a recently user resource.

Returns:

  • (TrueClass)

    true if the recent chooser should show tooltips, false otherwise.

#show_tips=(show_tips) ⇒ nil

Sets whether to show a tooltips containing the full path of each recently used resource in a Gtk::RecentChooser widget.

Parameters:

  • show_tips (TrueClass)

    true if tooltips should be shown

Returns:

  • (nil)

#sort_typeGtk::RecentSortType

Gets the value set by gtk_recent_chooser_set_sort_type().

Returns:

#sort_type=(sort_type) ⇒ nil

Changes the sorting order of the recently used resources list displayed by chooser.

Parameters:

Returns:

  • (nil)

#unselect_all(chooser) ⇒ nil

Parameters:

Returns:

  • (nil)

#unselect_uri(chooser, uri) ⇒ nil

Parameters:

Returns:

  • (nil)