Next: , Previous: GtkRecentManager, Up: Top


148 GtkRecentChooser

Interface implemented by GtkRecentChooserWidget, GtkRecentChooserMenu and GtkRecentChooserDialog

148.1 Overview

<gtk-recent-chooser> 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-recent-chooser-widget>, <gtk-recent-chooser-dialog> and <gtk-recent-chooser-menu>.

Recently used files are supported since GTK+ 2.10.

148.2 Usage

— Class: <gtk-recent-chooser>

Derives from <ginterface>.

This class defines the following slots:

recent-manager
The RecentManager object to use
show-private
Whether the private items should be displayed
show-not-found
Whether the items pointing to unavailable resources should be displayed
show-tips
Whether there should be a tooltip on the item
show-icons
Whether there should be an icon near the item
sort-type
The sorting order of the items displayed
select-multiple
Whether to allow multiple items to be selected
filter
The current filter for selecting which resources are displayed
limit
The maximum number of items to be displayed
local-only
Whether the selected resource(s) should be limited to local file: URIs
— Signal on <gtk-recent-chooser>: selection-changed

This signal is emitted when there is a change in the set of selected recently used resources. This can happen when a user modifies the selection with the mouse or the keyboard, or when explicitely calling functions to change the selection.

Since 2.10

— Signal on <gtk-recent-chooser>: item-activated

This signal is emitted when the user "activates" a recent item in the recent chooser. This can happen by double-clicking on an item in the recently used resources list, or by pressing

Since 2.10

— Function: gtk-recent-chooser-set-show-private (self <gtk-recent-chooser>) (show_private bool)
— Method: set-show-private

Whether to show recently used resources marked registered as private.

chooser
a <gtk-recent-chooser>
show-private
#t’ to show private items, ‘#f’ otherwise

Since 2.10

— Function: gtk-recent-chooser-get-show-private (self <gtk-recent-chooser>) ⇒  (ret bool)
— Method: get-show-private

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

chooser
a <gtk-recent-chooser>
ret
#t’ if the recent chooser should show private items, ‘#f’ otherwise.

Since 2.10

— Function: gtk-recent-chooser-set-show-icons (self <gtk-recent-chooser>) (show_icons bool)
— Method: set-show-icons

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

chooser
a <gtk-recent-chooser>
show-icons
whether to show an icon near the resource

Since 2.10

— Function: gtk-recent-chooser-get-show-icons (self <gtk-recent-chooser>) ⇒  (ret bool)
— Method: get-show-icons

Retrieves whether chooser should show an icon near the resource.

chooser
a <gtk-recent-chooser>
ret
#t’ if the icons should be displayed, ‘#f’ otherwise.

Since 2.10

— Function: gtk-recent-chooser-set-local-only (self <gtk-recent-chooser>) (local_only bool)
— Method: set-local-only

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 ‘#t’ (the default) then the shown resources are guaranteed to be accessible through the operating system native file system.

chooser
a <gtk-recent-chooser>
local-only
#t’ if only local files can be shown

Since 2.10

— Function: gtk-recent-chooser-get-local-only (self <gtk-recent-chooser>) ⇒  (ret bool)
— Method: get-local-only

Gets whether only local resources should be shown in the recently used resources selector. See gtk-recent-chooser-set-local-only

chooser
a <gtk-recent-chooser>
ret
#t’ if only local resources should be shown.

Since 2.10

— Function: gtk-recent-chooser-set-limit (self <gtk-recent-chooser>) (limit int)
— Method: set-limit

Sets the number of items that should be returned by gtk-recent-chooser-get-items and gtk-recent-chooser-get-uris.

chooser
a <gtk-recent-chooser>
limit
a positive integer, or -1 for all items

Since 2.10

— Function: gtk-recent-chooser-get-limit (self <gtk-recent-chooser>) ⇒  (ret int)
— Method: get-limit

Gets the number of items returned by gtk-recent-chooser-get-items and gtk-recent-chooser-get-uris.

chooser
a <gtk-recent-chooser>
ret
A positive integer, or -1 meaning that all items are returned.

Since 2.10

— Function: gtk-recent-chooser-set-show-tips (self <gtk-recent-chooser>) (show_tips bool)
— Method: set-show-tips

Sets whether to show a tooltips on the widget.

chooser
a <gtk-recent-chooser>
show-tips
#t’ if tooltips should be shown

Since 2.10

— Function: gtk-recent-chooser-get-show-tips (self <gtk-recent-chooser>) ⇒  (ret bool)
— Method: get-show-tips

Gets whether chooser should display tooltips.

chooser
a <gtk-recent-chooser>
ret
#t’ if the recent chooser should show tooltips, ‘#f’ otherwise.

Since 2.10

— Function: gtk-recent-chooser-set-show-numbers (self <gtk-recent-chooser>) (show_numbers bool)
— Method: set-show-numbers

Whether to show recently used resources prepended by a unique number.

Do not use this function: use gtk-recent-chooser-menu-set-show-numbers instead.

chooser
a <gtk-recent-chooser>
show-numbers
#t’ to show numbers, ‘#f’ otherwise

Since 2.10

— Function: gtk-recent-chooser-get-show-numbers (self <gtk-recent-chooser>) ⇒  (ret bool)
— Method: get-show-numbers

Returns whether chooser should display recently used resources prepended by a unique number.

Do not use this function: use gtk-recent-chooser-menu-get-show-numbers instead.

chooser
a <gtk-recent-chooser>
ret
#t’ if the recent chooser should show display numbers, ‘#f’ otherwise.

Since 2.10

— Function: gtk-recent-chooser-set-sort-type (self <gtk-recent-chooser>) (sort_type <gtk-recent-sort-type>)
— Method: set-sort-type

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

chooser
a <gtk-recent-chooser>
sort-type
sort order that the chooser should use

Since 2.10

— Function: gtk-recent-chooser-get-sort-type (self <gtk-recent-chooser>) ⇒  (ret <gtk-recent-sort-type>)
— Method: get-sort-type

Gets the value set by gtk-recent-chooser-set-sort-type.

chooser
a <gtk-recent-chooser>
ret
the sorting order of the chooser.

Since 2.10

— Function: gtk-recent-chooser-set-current-uri (self <gtk-recent-chooser>) (uri mchars) ⇒  (ret bool)
— Method: set-current-uri

Sets uri as the current URI for chooser.

chooser
a <gtk-recent-chooser>
uri
a URI
error
return location for a <g-error>, or ‘#f
ret
#t’ if the URI was found.

Since 2.10

— Function: gtk-recent-chooser-get-current-uri (self <gtk-recent-chooser>) ⇒  (ret mchars)
— Method: get-current-uri

Gets the URI currently selected by chooser.

chooser
a <gtk-recent-chooser>
ret
a newly allocated string holding a URI.

Since 2.10

— Function: gtk-recent-chooser-get-current-item (self <gtk-recent-chooser>) ⇒  (ret <gtk-recent-info>)
— Method: get-current-item

Gets the <gtk-recent-info> currently selected by chooser.

chooser
a <gtk-recent-chooser>
ret
a <gtk-recent-info>. Use gtk-recent-info-unref when when you have finished using it.

Since 2.10

— Function: gtk-recent-chooser-select-uri (self <gtk-recent-chooser>) (uri mchars) ⇒  (ret bool)
— Method: select-uri

Selects uri inside chooser.

chooser
a <gtk-recent-chooser>
uri
a URI
error
return location for a <g-error>, or ‘#f
ret
#t’ if uri was found.

Since 2.10

— Function: gtk-recent-chooser-unselect-uri (self <gtk-recent-chooser>) (uri mchars)
— Method: unselect-uri

Unselects uri inside chooser.

chooser
a <gtk-recent-chooser>
uri
a URI

Since 2.10

— Function: gtk-recent-chooser-select-all (self <gtk-recent-chooser>)
— Method: select-all

Selects all the items inside chooser, if the chooser supports multiple selection.

chooser
a <gtk-recent-chooser>

Since 2.10

— Function: gtk-recent-chooser-unselect-all (self <gtk-recent-chooser>)
— Method: unselect-all

Unselects all the items inside chooser.

chooser
a <gtk-recent-chooser>

Since 2.10

— Function: gtk-recent-chooser-get-items (self <gtk-recent-chooser>) ⇒  (ret glist-of)
— Method: get-items

Gets the list of recently used resources in form of <gtk-recent-info> objects.

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

chooser
a <gtk-recent-chooser>
ret
A newly allocated list of <gtk-recent-info> objects. You should use gtk-recent-info-unref on every item of the list, and then free the list itself using g-list-free.

Since 2.10

— Function: gtk-recent-chooser-add-filter (self <gtk-recent-chooser>) (filter <gtk-recent-filter>)
— Method: add-filter

Adds filter to the list of <gtk-recent-filter> objects held by chooser.

If no previous filter objects were defined, this function will call gtk-recent-chooser-set-filter.

chooser
a <gtk-recent-chooser>
filter
a <gtk-recent-filter>

Since 2.10

— Function: gtk-recent-chooser-remove-filter (self <gtk-recent-chooser>) (filter <gtk-recent-filter>)
— Method: remove-filter

Removes filter from the list of <gtk-recent-filter> objects held by chooser.

chooser
a <gtk-recent-chooser>
filter
a <gtk-recent-filter>

Since 2.10

— Function: gtk-recent-chooser-list-filters (self <gtk-recent-chooser>) ⇒  (ret gslist-of)
— Method: list-filters

Gets the <gtk-recent-filter> objects held by chooser.

chooser
a <gtk-recent-chooser>
ret
A singly linked list of <gtk-recent-filter> objects. You should just free the returned list using g-slist-free.

Since 2.10

— Function: gtk-recent-chooser-set-filter (self <gtk-recent-chooser>) (filter <gtk-recent-filter>)
— Method: set-filter

Sets filter as the current <gtk-recent-filter> object used by chooser to affect the displayed recently used resources.

chooser
a <gtk-recent-chooser>
filter
a <gtk-recent-filter>

Since 2.10

— Function: gtk-recent-chooser-get-filter (self <gtk-recent-chooser>) ⇒  (ret <gtk-recent-filter>)
— Method: get-filter

Gets the <gtk-recent-filter> object currently used by chooser to affect the display of the recently used resources.

chooser
a <gtk-recent-chooser>
ret
a <gtk-recent-filter> object.

Since 2.10